How can i determinate the player's speed?

Hello, i was coding a spring code, but i was able to sprint when i was idle, and an animation is playing, how can i determinate the player’s speed? or if the player is moving or not. I tried HumanoidState but it say running even when im idle…

1 Like

Use the Running event and then check if the parameter of it is equals or below 0
(The running event has the player speed as parameter)
And then when it is 0 you stop the animation

1 Like

Can you please elaborate? as i dont know what you are talking about.

Humanoid has Running event

Humanoid.Running:Connect(function(speed) --Paremeter of it is the speed the player is walking
if speed <= 0 then
      --If the player speed is 0 or below then stop the animation
      animation:Stop()
end
end)
1 Like

Alright, thank you very much, have a good day :wink:

No problem, Hope you have a good scripting session.

1 Like