How to get a players character movement direction relative to the camera?

As in the title. I want to get the movement direction of a player, from the perspective of the camera, so if the camera is behind the player and they press A, the camera will see them going to its left. If you do the same, but with the camera facing forward, it should still see the character going left. Using the humanoids MoveDirection property, if we rotate the camera it will show a different direction, so if we hold A and rotate the camera, the vectors will change, which doesnt let me detect what direction the humanoid is walking in accurately.

Im attempting to be able to get the direction of the character, for a side dash ability, which requires me to know what side the player is walking on. I couldn’t find a solution on the forum for this.

bit of an interesting explination, to itterate you want to be able to check if the players character is on the left side of the screen/camera or right side.

for this your most likely want to use cframe.
local DirectionToCharacter = Cframe.LookAt(Camera.CFrame.Position, CharacterPosition)

if DirectionToCharacter.LookVector.X < Camera.CFrame.LookVector.X then
– Its Left
end

i would arguably look at using angles as opposed to direction(due to up/down angle) but this is a rough route to do this

sorry for formating, im on a micro keyboard rn

MoveDirection = ...
relative_cf = game.Workspace.Camera.CFrame:VectorToWorldSpace(MoveDirection)

This will give you a direction vector based on the prospective of the camera

You didn’t post any scripts… There is nothing to help you work with.