Created
July 13, 2016 06:56
-
-
Save Deozaan/ff451d586dfd53a4c86f316bffb9f150 to your computer and use it in GitHub Desktop.
TrulyBoringLerpDemo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class BoringLerpDemo : MonoBehaviour { | |
Vector3 startPosition; | |
Vector3 endPosition; | |
float elapsedTime = 0; | |
void Start() { | |
startPosition = transform.position; | |
endPosition = startPosition + (Vector3.right * 10); | |
} | |
void Update() { | |
transform.position = Vector3.Lerp(startPosition, endPosition, elapsedTime); | |
elapsedTime += Time.deltaTime; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment