Best way to check if the player is moving & what direction they are moving?

I’m sorry I don’t quite understand your question.

2 Likes

To anyone who stumbles on this and want’s it in local space as well, its:

local movementDirection = WorldMovingDirection(RootPart.CFrame:VectorToObjectSpace(MoveDirection))

Huge thanks to PremiumJay for that function :pray:

6 Likes

i needed that function bro thanks i know this last 7 months but ion care

1 Like

you can use this instead of calculation functions if that helps your problem

1 Like

I have one question though, Does it return a rotation in angles so for example, If I was moving right, would it return a value like (-90, 0, 0) or something?

It returns a Vector3 (directional unit vector) on the XZ (flat) plane that describes which direction the player is moving in. If you’re using the code snippet I sent, it snaps to 90 degree increments. So it will return one of these:

  • A vector pointing north in world space
  • A vector pointing south in world space
  • A vector pointing east in world space
  • A vector pointing west in world space
1 Like