LockCenter/LockCurrentPosition MouseBehaviors not working on Orbital/Watch CameraTypes

Starting today, LockCenter/LockCurrentPosition MouseBehaviors no longer work correctly for Orbital/Watch CameraTypes. The mouse will be moved to the center of the screen for LockCenter, but then the mouse can be freely moved immediately afterwards. It seems the Orbital/Watch cameras are resetting MouseBehavior?

Repro.rbxl (13.7 KB)

In the repro, the localscript waits 2 seconds and then sets the cameratype to orbital + sets mouse behavior to LockCenter. After the mouse is moved to the center, it becomes unlocked and I can move it around freely again.

4 Likes

Glad to see I am not the only one having issues with the camera. I’m not having the same exact issue as what you’re describing, but I am experiencing some very funky behavior with setting the Camera CFrame using the Scriptable CameraType. Some CFrame values make the camera start tweening forwards randomly.

Of course I figured it was an issue on my end first, but the issue started happening today after not touching any code associated with the functions described above. I’ll still do more testing to find out if it’s on my end, but seeing as you are having weird camera trouble too starting today I suspect it is a result of a change on Roblox’s end.

1 Like

If it started happening today with no changes on your end, definitely sounds like a Roblox issue. If you can provide a repro file that demonstrates the issue, the engineers should be able to figure out what’s going on and fix it.

The repro from that bug report about the Follow camera with lockcenter uses lock center and orbital, try that.

This is definitely a Roblox bug. Having some issues as well.

Probably related to this:
https://twitter.com/MaxGeee1019/status/988893673516564481

1 Like

This doesn’t function correctly

This was not the case before these changes. With the appropriate flag disabled, setting MouseBehavior locks the mouse without needing to reset it in a loop.

Plus, the camera still functions as if LockCenter/LockCurrentPosition is disabled.

I can confirm something has changed with Orbital camera. Before this afternoon, I could set the OrbitalCamera to be zoomed in using CameraMaxZoomDistance and CameraMinZoomDistance as the same value.

I was locking the mouse with UserInputService.MouseBehavior
In order to allow the mouse 2 button to not have to be pressed to rotate the camera, I was using this combination of settings:

UserInputService.MouseBehavior : Enum.MouseBehavior.LockCenter
Camera.CameraType : Enum.CameraType.Orbital
GameSettings.RotationType : Enum.RotationType.CameraRelative

Although this was sort of a hack, I was trying to emulate MouseLockSwitch without forking the control scripts.

Sample code:

function LocalUserCameraManager:_lockDirection()
	if self._torsoLockedToCamera then
		if self._mouseLocked then
			pcall(function()
				GameSettings.RotationType = Enum.RotationType.CameraRelative
			end)
		end
	else
		pcall(function()
			GameSettings.RotationType = Enum.RotationType.MovementRelative
		end)
	end

	self.torsoLockedToCameraValue.Value = self._torsoLockedToCamera
end

function LocalUserCameraManager:_lockMouse()
	UserInputService.MouseBehavior = self._mouseLocked and Enum.MouseBehavior.LockCenter or Enum.MouseBehavior.Default
end

function LocalUserCameraManager:_lockCamera()
	if self._mouseLocked then
		self._camera.CameraType = Enum.CameraType.Orbital
	end
end

function LocalUserCameraManager:SetMouseLockMode(isEnabled)
	self._mouseLocked = isEnabled
	self:_lockCamera()
	self:_lockMouse()
	self:_lockDirection()
end

I hope this gets fixed, my game is literally unplayable like this

adding @AllYourBlox to the thread.

If your game is broken, can you post a link and what is broken?

I’m using a custom camera using ‘scriptable’ in my game, and the camera is completely stuck on all cameramodes… Don’t know what to do

1 Like

Right now, there are in total 3 repro files for 3 different bugs caused by this update.

One (top of this thread)
Two
Three (This one is affecting me the most)

As these bugs are making some games unplayable, hoping for a roll back ASAP.

Thank you for reporting this issue!

Our engineering team are actively looking into this issue and will follow up with more updates soon.

1 Like

Opening a crate and going to your inventory makes the camera go far away. :confused:

Yea, I’m having issues with using the Interpolate function of the Camera on type Scriptable, its like something else is stoping the tweening of the Position part of the camera but not the direction.
Example:

Where it is suppose to tween to:

Code I am using to move the camera (obviously Local Script)

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable workspace.CurrentCamera:Interpolate(workspace.Plates.Cam.CFrame,workspace.Plates.SwingTarget.CFrame,.3)

Place: https://www.roblox.com/games/598947721/HCBB-9v9#!/game-instances

The change has been reverted. The LockCenter and LockCurrentPosition issues are going to be fixed, but a few of the behaviors reported are relying on long-existing bugs or unsupported behavior (like having WASD and mouse control of a scriptable or fixed camera due to Studio build camera C++ code being invoked in a game setting).

Also, Camera:Interpolate() is slated for deprecation and will actually be going away as it’s the only remaining bit of C++ camera code that still executes. If you use Camera:Interpolate(), you should convert your code to use TweenService or do your own tweening (CFrame.lerp and Vector3:lerp can do linear interpolation of translations, and CFrame:lerp does proper slerp of rotation CFrames using quaterions under the hood, just FYI).

5 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.