The GetMovementDirection function seems to be doing the brunt of the work. Since its on github it’s a lot harder to quote, but it returns the character’s movement direction if they’re moving, and if not, it returns the direction of the camera. I would assume that means the player would start moving in the direction of the camera but accessing it after that is unhelpful, right?
If im not misunderstanding this, why not just have the bodyvelocity move in the direction of the Camera’s lookvector? the camera itself is attached to the player, and is always looking at it. so if you just attach the movementdirection to the camera’s lookvector, the movement will already be relative to the player’s movement. let me know I’f im misunderstanding what you’re trying to do.
If it’s not, I’d start off by utilizing the function CFrame.LookAlong which just takes the LookVector instead of a place to look at, just makes the code a lot easier to read. My best guess is that you’re trying to have the camera face a certain way, and that you’d be able to press A or D so that you can change direction. If that’s what you’re talking about, you can use the LookAlong function again to comine your inputs. Instead of using the lookVector, you can use the RightVector. Instead of going in the Camera’s LookVector, you can set the movementdirection to the camera’s RightVector if the D key is pressed, and negate the RightVector (-) if the A key is pressed. You can actually just add the RightVector (or negated RightVector) and LookVector, and since they’re both Vector3s, you can use .Unit so that if W is pressed at the same time as A or D, the returned movement direction is still forwards but can be straying.
I really hope this helps! And I commend you for actually taking the time to learn how to code, you really dont see that here anymore.