Mouse lock not respecting UserGameSettings.RotationType

In the past, setting UserGameSettings.RotationType to MovementRelative would allow the player’s character to move independent of the camera when the user has mouse lock enabled.

For example, when the user moves left, their character faces left, instead of remaining locked in the direction of the camera. I noticed this several months ago but thought it was on my end. I’m trying to setup the same functionality in a new project and seem to be encountering the same issue, leading me to believe this is a bug.

Repro steps:

  1. Create a LocalScript in StarterPlayerScripts with the following contents:
    local UserGameSettings = UserSettings():GetService("UserGameSettings")
    UserGameSettings.RotationType = Enum.RotationType.MovementRelative
    
  2. Press Shift to enable mouse lock.
  3. Use WASD to move the character without touching the mouse. Observe that the character stays locked along the direction the camera is facing.
1 Like

Please see my response to a similar issue in Scripting Support:

2 Likes

Good to know, thanks for the info. I’ll consider forking the PlayerModule so I can modify this in the meantime until it’s fixed.

1 Like

Currently working around this issue with the following code snippet:

local afterCamera = Enum.RenderPriority.Camera.Value + 1
RunService:BindToRenderStep("MovementRelative", afterCamera, function()
	UserGameSettings.RotationType = Enum.RotationType.MovementRelative
end)

Since UpdateMouseBehavior() is bound to the priority of Enum.RenderPriority.Camera.Value, I’m using a value one above that to immediately override the RotationType to the value I’m looking for. This comes with the benefit of not having to fork the PlayerModule in any way.

Hopefully this can get patched internally so I don’t need to hack around it.

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.

I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved?