LockCurrentPosition no longer working with Orbital Cameras

This issue started happening between 15th and 21st February 2020.

I have discussed and trialled this issue within Studio on a number of windows-10 machines within a number of places. Additionally - I’ve sent this to other friends for testing and the same result is occuring (windows 10)

As you can see (in the video attached) I am unable to get mouse LockCurrentPosition to work within Orbital Cameras. I am able to get a delta change in output when zoomed in all the way to first person. As I rotate the camera (in third person - holding right click to do so) you can see (in the video attached) a change of delta is detected in the output. Asides from this - I am not able to get Mouse LockCurrentPosition to work OR Delta to change.

Repro
For Reproduction purposes; I have attached a minimal place file to the thread which resembles that of the video clip.
LockCurrentPosition & Delta Test.rbxl (20.0 KB)

The Correct behaviour of the reproduction is:
The mouse locks to the current position upon game launch and outputs a delta value - Regardless of camera position.

2 Likes

This is still an issue I have been having, with still no fix in sight.
I have also made a place to demonstrate the broken functionality.

I am going to be bumping this post for the foreseeable future until it is fixed as it is making it quite hard to continue working on my projects when there is a huge chunk of the project just not working.

After some digging, I would where the issue is caused, it is in lines 1129 through to 1134 in the BaseCamera module in the BaseCamera:UpdateMouseBehavior() function as it fires this function every frame and sets MouseBehavior to default. To fix this I just commented these lines out which made locking the mouse possible again without breaking any functionality that I could see.

Just stick this ModuleScript into StarterPlayerScripts and it should fix the issue
https://www.roblox.com/library/4946925619/PlayerModule-Fix

I still think this is ridiculous that a bug that has been reported over a month ago, that has a fix as simple as just commenting a few lines out still hasn’t been fixed on Roblox’s end. This is just ludicrous.

1 Like

This is still broken with LockCenter too.

Even this two line LocalScript in StarterPlayerScripts fails to work unless I use the corrected module given above.

local UserInputService = game:GetService("UserInputService")
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter

Correction
There’s a fix that’s not documented.

local UserInputService = game:GetService("UserInputService")

game:GetService("RunService"):BindToRenderStep("MouseLock", Enum.RenderPriority.Camera.Value + 1, function()
	UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
end)