|
I have been trying to write a javascript that will make a game object's position in the same position of the mouse without clicking to drag it. Here is what I wrote:
The problem is that the position of the mouse is shown by pixels and the object will move with what the positionOfMouse variable is. I cannot figure out a way for it to move exactly with the mouse. Could someone help me with making a script that will cause the object to be in the location of the mouse? Thanks.
(comments are locked)
|
|
I mentioned that I do not want to click it and that I just want it to always be in the position of the mouse.
Jun 26 '10 at 01:18 AM
0V3RWR173D
The reason for your problem -- and the solution -- are the same as in that question. The only difference between the two is that you're not checking to see if the mouse button is down.
Jun 26 '10 at 01:47 AM
Tetrad
I am not sure what to replace "(Input.GetMouseButton(0))" with so that it is without pressing the mouse button.
Jun 26 '10 at 10:55 PM
0V3RWR173D
Never mind I tried just (Input) and it does what I want it to do.
Jun 26 '10 at 11:08 PM
0V3RWR173D
(comments are locked)
|
