- Home /
move position of child object on update - increment too small?
Hi - I have an object that I simply want to move from its current position to a known position, but when I try to script it, the object moves much further than expected / further than in the editor window. Anybody know what I'm doing wrong? I've tried both position and positionLocal. I think it may have to do with the fact that the number values are so small.
So currently the y position of the object I want to move in the editor window is: .0007. I want to move it to .001. Here's my code:
var leverPos = lever.transform.position.y;
var leverMoveMax = .001;
function Start(){
lever.transform.localPosition.y = leverMoveMax;
}
Comment
Best Answer
Answer by whydoidoit · Jun 14, 2012 at 05:42 PM
It's probably because in the Editor window the position is the global position not the localPosition. Try:
level.transform.position.y = leverMoveMax;
Your answer
![](https://koobas.hobune.stream/wayback/20220613072758im_/https://answers.unity.com/themes/thub/images/avi.jpg)