When using SetMoveOverride on the user normally, the movement will be relative to the direction the player is facing.
If you set the camera to something other than the user’s player, then the movement will be relative to the direction the player was facing when the camera changed.
In my opinion, this should be relative to the forward direction of the player, independent of the camera. For example, in the demo when you hold down W, the player runs up. It would follow that if the movement override was (0, 1), that the player would also run up, since the movement override is simulating the movement input.
If it’s intended, it needs to be documented somewhere. I spent a lot of hours trying to figure out why my pathing wasn’t working, assuming I understood that SetMoveOverride operated relative to the direction the player was facing.
How do you cause this bug?
Add a script to the player that changes the SetMoveOverride add values to different values with a wait period. Run this script with the camera set to the player.
The player will move relative to the direction the player is facing. The player’s forward direction.
Next, change the user camera to a camera in the world and perform the same steps. Now, the player’s movement will be relative to the direction the player was facing when the camera was changed.
Screenshots / video of bug:
This game will toggle
self:GetEntity():SetMoveOverride(Vector2D.Zero, Vector2D.New(0, 1)) when you press E. If you were in action camera, the player would continue in the direction you’re facing when you pressed the button.
However, in this demo, you will walk towards the bottom of the screen, always, because that’s the direction the player was facing when the camera changed.
Which platform: PC / Stadia
Which input: Controller / keyboard + mouse
Your Crayta username:
How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible): Every time
Time + date seen: August 17 2021
Version number (found in Help tab in Settings): 0.7.619.108548