Move or Interpolate Over Time in Unity

Move or 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.

Понравилась статья? Поделиться с друзьями:
Автор snezhok_13
Writes about gamedev. Graphics programmer on AAA projects.

Leave a Reply

Your email address will not be published. Required fields are marked *