Change animator parameters in script C#

Hello, im currently trying to change a float parameter in my animator. The float is called “Speed” and is set so if it is above .1 it will change animation from idle to run. and the other way around. Now how do i change it in a script to make it look and work good? Thanks

Hey !

You can do this just by writing a script in C# :

private Animator anim;
public  float Speed;
void Start()
    anim = GetComponent<Animator> ();
void Update()
    anim.setFloat("Speed", Speed);

“Speed” is the name of the Animator Parameter and Speed is the float variable wich is relative to your Player Speed !

If you need any more help just ask