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.

Читай также:  Interview with Banshee Game Engine Programmer Marko Pintera
Like this post? Please share to your friends: