Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to force MouseLockSwitch?

Ever since the reddit post about finding a solution in the core camera scripts I've always wondered how to re-do this, since the code has changed significantly since the post date, I'm looking for ideas on how to do this, not code itself. Hope you guys can help.

1 comment

0

im pretty sure you can lock the mouse to the center with UserInputService and MouseBehavior, then you can use DeltaX and DeltaY to offset the camera to where they attempt to drag the mouse, which is the same effect that mouselock does.

1 answer

✓ Accepted answer

You will want to press play in studio, and in the explorer navigate to Players -> [your player name] -> PlayerScripts and copy the CameraScript you find in there (Ctrl+C). Then press stop to exit the game, and paste the ControlScript into StarterPlayer -> StarterPlayerScripts. Then expand the CameraScript in the explorer and you will find the RootCamera module. Open RootCamera up for editing.

On line 198, you will need to change this code to be true

this.ShiftLock = false

On line 248, you will need to replace return ShiftLockController:IsShiftLocked() with this code

return true

1 comment

0

Thank you, this works.

This discussion is preserved as it was. New answers, comments, and votes are closed.