|
Right. I have tried asking many many people how to do this script and no one seems to get what it is I mean. Basically I want this to be a valid script
Which frustratingly it isn't. I want the mainCamera x and y co-ordinates to equal the x and y coordinates of the mouse cursor. It should be simple but it has given me a lot of difficulty. I do have a script that almost works but I don't think I'm going in the right direction so I'm not going to put it up because it just confuses people usually.
(comments are locked)
|
|
Input.mousePosition is a Vector3 already.... Are you working in C# or javascript? You tagged the question with c# in C# (C# scripts must be named the same as their class name, in this example CamMouse)
in Javascript
or, for fun and syntax similar to yours, in C#
Also, note that Input.mousePosition goes between (0,0,0) in the lower left corner, to (Screen.Width, Screen.Height, 0) in the upper right. Dude I love you, been stuck on this for ages!! I didn't mean to tag it as c#, it was an old script I was working on that was in c# but I'm glad I did because this works perfectly :D. I had a very similar script before but I missed out the word new and it didn't work. Rather annoying how 3 letters can be the difference between something working perfectly and it doing nothing at all.
Jan 13 '10 at 01:24 PM
Sam Beckham
(comments are locked)
|
