|
Hey, I am looking for a method to move a variable's value to 0, in 1.5 seconds. I have a variable, which holds 250 at the start. I have tried it this way, but it doesn't work.
(comments are locked)
|
|
Use Mathf.Lerp. So like this: Hope that helps, Klep Actually, I'll also clamp rate to 1.5 so we get it exactly right.
Apr 11 '12 at 01:53 PM
Kleptomaniac
(comments are locked)
|
|
Have a look at this: http://answers.unity3d.com/questions/35610/variable-that-decreases-after-a-certain-amount-of.html hope this helps you.
(comments are locked)
|
|
Looking at your code, it seems that you want to go from one color to another (maybe the colors just differ by alpha value) over a period of time. There is exactly a function for that. It is called: I'm going to ask you to study that in the Unity Scripting Reference documentation. But, from a high level, what I think you want is:
(comments are locked)
|
