Changing between walking and running animations

I want to make a script that switches between the walking and running animations in the animate script depending on your walkspeed, i.e. when the player’s walkspeed is above 30 and they are moving, use the run animation instead of walk. I have looked at some post but I couldnt find any that were up to date.

How would I go about this?

Try using this in your script:

if Walkspeed > (Your walkspeed that switch to running) then 
	(YourRunningAnimation):Play()
	(YourWalkingAnimation):Stop()
else 
        (YourWalkingAnimation):Play()
        (YourRunningAnimation):Stop()
end

Also, check if the Animation you want to run IsPlaying

1 Like