The following changes the variable myVar each frame, but how do I change it every certain number of milliseconds? Let's say every .1 seconds.
Mathf.Lerp(myVar, 0.0f, 0.5f)
The following changes the variable myVar each frame, but how do I change it every certain number of milliseconds? Let's say every .1 seconds.
Mathf.Lerp(myVar, 0.0f, 0.5f)
Use InvokeRepeating:
var myVar : float;
function Start () {
InvokeRepeating("LerpVar", .1, .1);
}
function LerpVar {
myVar = Mathf.Lerp(myVar, 0.0, someIncrement);
}