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

How do I lock shift lock switch so it stays active?

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?

1 answer

✓ Accepted answer

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.

1 comment

0

@ Step 3, roblox has added some stuff so it's a bit different. It's not line 197, it's line 200. Also, @ Step 4, not line 246, but line 249. Not trying to be pushy, just clarifying.

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