Is there a way for me to check what direction the player is moving in? I am making a first person shooter and was wondering if there is a way to tell what direction the player is moving in.
Do you mean NS/EW, that kind of thing?
direction relative to what exactly?
Relative to the character
Get velocity of player, normalize it.
Get forward vector of player character, normalize it
You have 2 vectors, where player is facing and where is going.
Dot product is cosine betwen those 2 vectors.
Now if you want only horizontal direction
multiply player direction and player velocity by: [1,1,0] to “zero” vertical values
to get where in the world player is moving simply pick values from NORMALIZED velocity vector
Get Velocity | Unreal Engine Documentation + Normalize | Unreal Engine Documentation = unit direction vector.