Speed won't work as a parameter

Hello. I’m trying to make my idle animation transition into walking animation for my character. I have a custom character and I’m controlling it with the 3rd person controller script that comes with unity.

The only real problem that I’m facing is that when I try to set Speed as a float parameter in the animator (as Unity tutorials suggest) and move my character, the float doesn’t change, making it useless as a parameter.

I’m rather confused, since I was led to believe that Speed with a capital ‘S’ accesses some variable somewhere in Unity that keeps track of the speed of your character.

Is there something I need to change, or do I need to write the script that keeps track of the speed myself?

“Speed” is not a special variable of any kind. You could call it “ThisIsMyVaraibleThatSaysHowFastIGo”. I think the issue, is that you have’t written a script that changes this. Something like this should work:

void Start()
{
	
	// get the animator
	animator = GetComponent<Animator>();
		
}

void Update()
{

    // your speed is either +1, 0, -1 depending on if you are going forward
    // or backwards. This may change depedning on how you control your character
    float inputSpeed = Input.GetAxis("Vertical");

    // set the float for the speed value
	animator.SetFloat("Speed", inputSpeed);

}

That is a C# script. This then needs to be attached to the gameobject in your scene that has the animator attached.