Make animation stop playing when the player stops moving

Whenever I stop moving (not pressing WASD but holding down shift) the animation still plays, how do I prevent this?

Here is a code snippet:

image

1 Like

You should check for the Humanoid’s MoveDirection Magnitude.
if humanoid.MoveDirection.Magnitude > 0 then --The player is moving
if not humanoid.MoveDirection.Magnitude > 0 then --Stop the animation
You should connect that to some kind of Event, like Humanoid.Changed and react to it.

2 Likes

Thanks dude, I was losing my mind over this