- Home /
smooth motion
Hey there!
What im trying to do is make this object move down to a certain distance smoothly, i have got it going the correct distance but it just jumps there now, how could i fix this?
Thanks!
while (i <= 5){ i = i + 1; trans = -1; transform.Translate (0, trans,0); }
Answer by efge · Feb 22, 2011 at 12:43 AM
Take a look at the reference for the function Vector3.Lerp.
There is a good example.
this works great except for one problem, the time at which this happens is not at the begging on the time, t(the var in lerp) is already finished(past 1).
so what happens is if I activate the lerp right as it is used it works, but if i wait a second or two it just jumps there...hm im stumped again
here is my new code
if (once){ t = Time.time transform.position = Vector3.Lerp(start.position, end.position, t/7); } if (Input.GetAxis ("jump")){ once = true; }
thanks again!
Your answer
![](https://koobas.hobune.stream/wayback/20220613105612im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Map level selection slide smoothly 3 Answers
Move Object With Angle In 2D 1 Answer
Stop Object From Moving After Key Release 2 Answers
Problem of creating smooth animations 3 Answers
Move from point A to point B, then destroy? ( java S) 2 Answers