Skip to content

Instantly share code, notes, and snippets.

@Deozaan
Created July 13, 2016 06:56
Show Gist options
  • Save Deozaan/ff451d586dfd53a4c86f316bffb9f150 to your computer and use it in GitHub Desktop.
Save Deozaan/ff451d586dfd53a4c86f316bffb9f150 to your computer and use it in GitHub Desktop.
TrulyBoringLerpDemo
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