Lock Center Not Working?

I honestly don’t know if this belongs under studio bugs or here, cause there are multiple reports of this years ago and staffs either replied with “we are on it now” or something like that, so i’m going to assume i’m in the wrong at this point…

game:GetService("RunService").RenderStepped:Connect(function()
    game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter;
end)

Shouldn’t this work perfectly fine? Am i doing something wrong? It seems like it locks it for 1 frame then resets it back to default. LockCurrentPosition works perfectly fine. I’m really starting to get annoyed by such a simple thing… If this was deprecated please let me know.

Out of curiosity why are you setting this in RenderStepped? This seems highly inefficient.

Apparently if you don’t it’ll reset it to default, so it needs to be constantly applied? Something about the default camera script overriding.

Yeah, there was a change at some point in the PlayerScripts:
StarterPlayerScripts[_NewStructure]/PlayerModule[.module]'s CameraModule stuff:
Update() gets called on the RenderStep, which in turn in calls UpdateMouseBehavior(), which
stomps UserInputService.MouseBehavior & UserGameSettings.RotationType
(which also messes-up any custom Shift-Mouse-lock style of camera rotation, ie. CameraRelative )

So unfortunately you’ll need to fork the StarterPlayerScripts/PlayerModule to modify the behavior
in UpdateMouseBehavior().

2 Likes