Move or Interpolate Over Time in Unity

How to interpolate over time in Unity

It is very frequent question on forums: “How to move or interpolate over time in Unity?”.

If you don’t use any tweener plugins, you can easily do it calculating delta for Lerp using time passed from start.

Like this, for example:

This script moves object to the center of container for 3 seconds. It is easily can be adapted to rotate over time, or to move object in 3D over time, etc.

Like this post? Please share to your friends:
Leave a Reply

:) :D :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: