Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How To Best Detect Movement?

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.

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.