Determine Character Walking


function Char(Char)
        local Humanoid = game.Workspace:WaitForChild(Char.Name):WaitForChild("Humanoid")
        if Humanoid.MoveDirection.X == 0 or Humanoid.MoveDirection.Y == 0 or Humanoid.MoveDirection.Z == 0 then
            self:DetermineWalking()
            print("NOT Walking")
            WalkBool = false
        elseif not Humanoid.MoveDirection.X == 0 or not Humanoid.MoveDirection.Y == 0 or not Humanoid.MoveDirection.Z == 0 then
            self:DetermineWalking(true)
            print("Walking")
            WalkBool = true
        end
    end


So I made this funtion when is called Using Run Service to determine if character is moving but it only prints “Not Walking” Can anyone help? This was made using for I,v in pairs too because I need to find HumanoidRootPart of each character :).

Have you tried MoveDirection.Magnitude?

Try looking at the example script they have.

if humanoid.MoveDirection == Vector3.new(0,0,0) then
    print("Not walking")
else
    print("Walking or Jumping")
end

Dang ok that worked thank you. :slight_smile:

1 Like