Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to force MouseLockSwitch?

Asked by 6 years ago

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.

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. RubenKan 3615 — 6y

1 answer

Log in to vote
2
Answered by 6 years ago

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
0
Thank you, this works. Shadowthaumaturge 97 — 6y
Ad

Answer this question