Please help I’ve been trying to solve this for the past few days I’m starting to lose my mind, I posted the same thing on the dev forum but there was no solution here is my previous Post
local ShiftLock = false
local UIS = game:GetService("UserInputService")
local Camera = workspace.CurrentCamera
local plr = game:GetService("Players").LocalPlayer
local mouse = plr:GetMouse()
UIS.InputBegan:Connect(function(Key)
if Key.KeyCode == Enum.KeyCode.E then
ShiftLock = not ShiftLock
end
end)
local Runservice = game:GetService("RunService")
Runservice.RenderStepped:Connect(function()
if not ShiftLock then return end
local Character = plr.Character
if not Character then return end
local HRP = Character:FindFirstChild("HumanoidRootPart")
if not HRP then return end
local CX, CY, CZ = Camera.CFrame:ToOrientation()
HRP.CFrame = CFrame.new(HRP.CFrame.p) * CFrame.fromOrientation(0, CY, 0)
Character.Humanoid.CameraOffset = Vector3.new(1.75, 0, 0)
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
end)
Problem: