Help me! I want to make a shift lock button so that mobile players can shift lock the same way as desktop users do!

This is the closest as I can get to replicating the shift-lock but I want to be able to use the ShiftLockController Module (located at PlayerScripts.CameraScript) that ROBLOX uses but I seem to have problems reading it and understanding how it works... Can someone guide me?


local plr = game:GetService('Players').LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild('HumanoidRootPart')

local camera = game.Workspace.CurrentCamera
local vector = Vector3.new(1,0,1)
local cframeNew = CFrame.new

game:GetService('RunService').Heartbeat:connect(function()
	local pos = hrp.Position
	hrp.CFrame = cframeNew( pos, pos + camera.CFrame.LookVector * vector)
end)

1 comment

0

connect is deprecated, use Connect