Detect Player Idle Character

I want to know when the player is idle, not using any actions or keys. The default animator does not do this, it will play the walk animation even as a character slides on ice with no WASD input.
Is there a better way to do this than to check that none of the keys are being used?

You can use the Player.Idled event which will fire two minutes after the player is idle! Very simple way to do this, I’m sure there’s other ways however.

Try using Humanoid.MoveDirection, which is as the name implies:

Pseudocode:

RunService.Heartbeat:Connect(function()
    if Humanoid.MoveDirection.Magnitude > 0 then
        print("player is moving")
    else
        print("idle")
    end
end)
4 Likes

Humanoid.Running has a Speed parameter:

Humanoid.Running:Connect(function(Speed)
    if Speed > 0.75 then
        -- Play walk animation
    else
        print("Player is idle")
    end
end)
3 Likes

This worked beautifully to Enable/Disable a ParticleEmitter acting as a dust trail when player runs. Exactly what I was looking for, thank you.