The title might be confusing a bit - I’ve been following along the stealth project tutorial - in the player movement part:
void ManageMovement(float horizontal, float vertical, bool isSneaking)
{
anim.SetBool(hash.sneakingBool, isSneaking);
if (horizontal != 0 || vertical != 0) // if there's any movement
{
ManageRotation(horizontal, vertical);
anim.SetFloat(hash.speedFloat, 5.5f, dampSpeed, Time.deltaTime);
}
else
{
anim.SetFloat(hash.speedFloat, 0f);
}
}
One more thing that is quite confusing me - it’s the speed of all what’s happening! - if we look at the animator, we’ll see that the speed of all the animations is set to ‘1’ (I don’t know what that means) - I know that if you lower the locomotion animation speed to 1.5 or something you’ll get the player to walk, and 5.5 to run - on line 23 we’re setting the “Speed” float variable to 5.5
anim.SetFloat(hash.speedFloat, 5.5f, dampSpeed, Time.deltaTime);
But I just don’t see where in the animator did we bind between this ‘Speed’ variable and the locomotion animation speed! - and yet if we manipulate this variable’s value the animation speed changes, how?
One other thing, if we set the ‘Speed’ to 5.5, shouldn’t the stealth animation also be at 5.5? - I’m confused - how is the speed of the animations handled in the animator and in code? how is everything connected? ((