- Home /
Problem with lerp positioning
I move a gamobject with lerp, it works fine but: assume endposition is (0,0,10) and the gameobject goes not exactly there but (0,0,0.99999) any solution?
Answer by proxyjan · Aug 19, 2014 at 07:32 AM
You mean (0,0,9.9999999)? If so, that's what it's like. You can assume 10 = 9.999999 in a game Engine but not mathematics. Unity sometimes change the positions by it's own when game starts, like (5,5,6) to (4.98980,5,6) and i don't know why! :D For your question, there is another reason, lerp changes a float or vector by time, and the time is same for all frames give or take, when two floats or vectors have big difference and deltaTime is 0.05 second, they have little time to match up. And the speed is high (X2 - X1)/t = V. :D And when they are too close, speed is that small witch doesn't effect in unity, so 9.999999 doesn't being added with that small number so remains that for the rest of his life.
Your answer
Follow this Question
Related Questions
Vector3.lerp doesn't work 1 Answer
move a gameobject to left/right while going up 1 Answer
Moving along a local axis with a slider.. 0 Answers
Turning character slowly with Slerp 1 Answer
Stop a Lerp from looping 3 Answers