How could I make something similar to shiftlock?

Hi devs, how could I make it when a player holds a tool it puts their camera into a state similar to shiftlock?

Any help appreciated!

1 Like

Take a look at this maybe?

I didn’t get any help from that thread.

You could use this tutorial: Scripting MOBILE SHIFT LOCK | Roblox Scripting Tutorial - YouTube

The video will show you how to make a shift lock system, although it is intended to be a mobile shift lock system. However, you could rework the script to active shift lock when the player equips the tool.

You could set the Humanoid.CameraOffset property to something like Vector3.new(3, 0, 0) when the tool is equipped and reset it to (0, 0, 0) when it is unequipped.

Example (LocalScript):

local character

script.Parent.Equipped:Connect(function()
	character = script.Parent.Parent --assuming the script is a child of the tool
	character.Humanoid.CameraOffset = Vector3.new(3, 0, 0)
end)

script.Parent.Unequipped:Connect(function()
	character.Humanoid.CameraOffset = Vector3.new(0, 0, 0)
end)