So I need to know which way is the best to detect Players Movement. Because I need one that activates by at the beginning of the round, checking if they're moving or not, and then one that activates if they ever stop moving. A way that Supports all devices.
COMMUNITY QUESTION
How To Best Detect Movement?
1 answer
You should use the Running event located in the humanoid. This event fires whenever the humanoid begins walking and stops walking, and also passes a parameter of the humanoid's speed.
local workspace = game:GetService'Workspace'
workspace.Player.Humanoid.Running:connect(function(speed) -- Speed is the humanoid's WalkSpeed
if speed > 0 then
print("Player is walking")
else
print("Player has stopped")
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
