Detect if non-player humanoid is walking?

I need to see if a non-player humanoid is walking. I use MoveTo() to move it.

I have already tried MoveDirection and Velocity. MoveDirection doesn’t work at all and Velocity is unreliable. Any other alternatives (preferably not using magnitude or region3s please).

Although this uses magnitude, it doesn’t use it like you’d usually expect.

Char.HumanoidRootPart.Changed:connect(function()
     if (Char.HumanoidRootPart.Velocity * Vector3.new(1,0,1)).magnitude > 0.5 then
—do stuff
     end
end)

Sorry for sloppy formatting, typed this from my phone.

Velocity isn’t unreliable when you combine it with magnitude to see the full force of the velocity rather than two separate horizontal movement directions.

3 Likes

Could use position and raycasting.

Use the Humanoid.Running event. Here is an example of its use:

humanoid.Running:connect(function(newSpeed)
    if newSpeed > 0.5 then -- Speed is 0.5, likely walking
        print("Player is walking")
    end
end)

That worked like a charm! Thanks