We use cookies on this site to enhance your user experience
Running
This event fires when the speed at which a Humanoid
is running changes.
Whilst running Humanoid|Humanoids
cover, on average, their Humanoid/WalkSpeed
in studs per second.
When the Humanoid
stops running this event will fire with a speed of 0.
See also
- For swimming and climbing see the
Humanoid/Swimming
andHumanoid/Climbing
events - You can also detect when a
Humanoid
is running using theHumanoid/StateChanged
event
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The speed at which the |
Code Samples
Humanoid.Running
The below assumes that there’s a player in Workspace named “Player” who has a Humanoid. It will print whether or not their character is running.
game.Workspace.Player.Humanoid.Running:Connect(function(speed) if speed > 0 then print("Player is running") else print("Player has stopped") end end)
Humanoid action events
This code, when run from a LocalScript
parented to a Player/Character
will listen to the Humanoid|Humanoid’s
action events and print when they are fired.
This code sample is intended to demonstrate when each event does, and does not, fire.
local character = script.Parent local humanoid = character:WaitForChild("Humanoid") humanoid.Climbing:Connect(function(speed) print("Climbing speed: ", speed) end) humanoid.FallingDown:Connect(function(isActive) print("Falling down: ", isActive) end) humanoid.GettingUp:Connect(function(isActive) print("Getting up: ", isActive) end) humanoid.Jumping:Connect(function(isActive) print("Jumping: ", isActive) end) humanoid.PlatformStanding:Connect(function(isActive) print("PlatformStanding: ", isActive) end) humanoid.Ragdoll:Connect(function(isActive) print("Ragdoll: ", isActive) end) humanoid.Running:Connect(function(speed) print("Running speed: ", speed) end) humanoid.Strafing:Connect(function(isActive) print("Strafing: ", isActive) end) humanoid.Swimming:Connect(function(speed) print("Swimming speed: ", speed) end)