Skip to content

Instantly share code, notes, and snippets.

@Azzizi
Created February 17, 2014 08:42
Show Gist options
  • Save Azzizi/9046957 to your computer and use it in GitHub Desktop.
Save Azzizi/9046957 to your computer and use it in GitHub Desktop.
Using Mathf.lerp()
class whatever : Monobehaviour
{
float lerpTimer = 0f;
void Update()
{
if ( /* The lerp is happening */)
{
lerpTimer += Time.deltatime;
alpha = Mathf.lerp(start, end, lerpTimer/duration);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment