|
how in script to detect if the object was moved within y axis?, i have a gameobject that should be moved up and down
(comments are locked)
|
|
In general, store the last position in a variable and check if the distance from the current position is greater than an epsilon. In your case, just do it with the y component. is this how i should do it? var lastposition : (whatsthedatatypeforthis?); var transform.position.y = 0; if (lastposition != transform.position.y){ Debug.log = "moved" }
Feb 13 '12 at 05:19 AM
charnew
If you just want a test on the height, it's a float then. Something like :
Feb 13 '12 at 06:29 AM
Berenger
(comments are locked)
|
