So I am trying to detect when a player is either moving backwards, forwards, left, right, diagonally forward to the right, diagonally forward to the left, diagonally backwards to the left, and diagonally backwards to the right
The problem is that I dont know which combinations of numbers for MoveDirection can be equivalent to the direction I stated above
edit: I forgot the word but basically what Im looking to create is locomotion
Oh alright gotcha he was using the velocity of the humanoid, I just need to replace that with my humanoid movedirection relative to my root’s cframe in object space
omg DUDE THANK YOU SO MUCH IT WORKED, also thank you to that guy from that post
Anyone else wondering how to do it with movedirection here is my code
local movedir = root.CFrame:VectorToObjectSpace(humanoid.MoveDirection)
local yDirection = math.atan2(movedir.X,movedir.Z)
local roundedDirection = math.ceil(math.deg(yDirection) - 0.5)
print(roundedDirection)