- Home /
How to change value of var?
Hi,
I need to Change value of var from 1 to 0.478. But I need to change it smothly via some time.
What method should I use?
Comment
Best Answer
Answer by zharik86 · Jan 24, 2015 at 09:32 AM
Simple way use Lerp (write on CSharp):
public float a = 1.0f;
public float b = 0.478;
public float speed = 4.0f;
void Update() {
a = Mathf.Lerp(a, b, speed * Time.deltaTime);
}
I hope that it will help you.
Your answer

Follow this Question
Related Questions
Is reffrencing a huge class better than reffrencing it's elements? 1 Answer
Expression denotes a `method group', where a `variable', `value' or `type' was expected 1 Answer
passing an arraylist to a separate script 1 Answer
Animation CrossFade Help Missing Method 1 Answer
Can't access enum property of an instantiated prefab. 1 Answer