How to get moving direction?

How can I get the walking direction of an npc(I am using humanoid:MoveTo() ) I need the walking direction relative to another npcs character or a players character.

I tried cframe:VectorToObjectSpace(v3) and it returned a vector 3 value( -0.553859532, 3, -11.1467381) however I am not sure how to use this to get to my goal.

I also know how to check if they are moving but that doesnt tell me the direction that I need.

I think there’s a property called “MoveDirection” inside the NPC’s humanoid.

1 Like

MoveDirection does not work whenever you are using MoveTo Im not sure why but it always returns 0,0,0

You can use the Velocity property of the HumanoidRootPart to get the direction and if you are moving.

1 Like

The Velocity is still 0,0,0 I think it is because im using MoveTo

Huh? It shouldn’t be affected at all by it. How are you checking the Velocity?

image

Thanks I figured it out. If you are reading this to learn

Check velocity and then check x and z to see if moving right or left