I'm making a survival game and I want the player to stay locked in Shift Lock Switch.
Is there a way to do this?
Main Idea
Shift Lock
is something I learned while making a 3rd person shooter. Shift Lock is ideal in any third person game. Now to do this we will be changing a default roblox camera script.
Step 1Click play. Easy as that. Now go into starter player scripts, and look for the camera script. Copy this script, not the script, right click the Camera Script
and click copy. Now click stop. Now go to The Explorer
, and go into Starter Player
, and click the arrow next to it.
Step 2Paste the Camera Script inside of the StarterPlayerScripts
and click the arrow next to the CameraScript
.
Step 3Now click open the Root Camera
script and go to line 197. There should be a paragraph of script that looks like the following:
this.ShiftLock = false this.Enabled = false local isFirstPerson = false local isRightMouseDown = false local isMiddleMouseDown = false this.RotateInput = ZERO_VECTOR2 this.DefaultZoom = LANDSCAPE_DEFAULT_ZOOM this.activeGamepad = nil
now on line 197, you change the
this.ShiftLock = false
to
this.ShiftLock = true
Step 4
Now go to line 246 and there should be a paragraph that looks like the following.
function this:GetShiftLock() return ShiftLockController:IsShiftLocked() end
change that line of code to this:
function this:GetShiftLock() return true end
Now you should be all set.