|
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)
(comments are locked)
|
|
Use InvokeRepeating: how do I turn off the invokerepeating once it's gotten to the target desired number?
Dec 29 '10 at 03:47 PM
dissidently
the other problem, aside from not being able to turn it off... it seems to launch straight to the destination value... doesn't seem to take it's time getting there at all.
Dec 29 '10 at 03:51 PM
dissidently
Use CancelInvoke() to turn it off. What is your someIncrement? Try a lower value.
Dec 29 '10 at 04:46 PM
Peter G
(comments are locked)
|

If you use Mathf.Lerp(myVar, 0.0f, 0.5f * Time.deltaTime) you will get a consistent lerp rate no matter what the frame rate.