Character is slowly running when in the Idle Animation

Hi when I play, the character is very slowly running in place during the Idle animation. And I am having trouble tracking down the root cause.
it is to do with the FreeLookSpeed as the BlendTree looks like this on idle pose with no movement Input being applied or registered ( I used the [field : serializeField] and both X and Y show zero until i press a key or Push the gamepad. Then it registers correctly to 1

I cant track down where the 0.5 input is coming from.
This is my PlayerStateMachine.cs

And this is my PlayerTestState.cs

Everything to me looks as it should be and for the life of me I cant figure out why the animation thinks there is a value being passed in to the FreeLookSpeed parameter.

Many Thanks
Paul

I need to specify that I have not done this course yet, so I do not know what the code here is supposed to look like, but
image
This code is always setting the “FreeLookSpeed”. It checks if the MovementValue == Vector3.zero and sets it to 0, but then after that it sets it again to whatever this outputs

statemachine.Animator.SetFloat("FreeLookSpeed", 1.0f, 0.1f, deltaTime);

you probably want to return after setting to 0

1 Like

Of course!
I missed out the return when I added to the function.
Thanks very much

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms