Hello there,
I'm making a 3rd person platformer/shooter, and have been tearing my hair out over the camera. You see, I want a version of ShiftLock that doesn't focus the camera so low, since I still need to aim. I tried many different scripts I have dug up but cant seem to make heads or tails of any of them, or how to modify them correctly-- whenever they weren't broken. Any help is greatly appreciated with this topic, and I wanted to thank you for your patience, as this seems like such a question asked ad-nauseum.
I've tried this script here, but cant seem to move my camera along the Y-Axis. I also wanted to know if there was a way to enable and disable this modified camera upon the equipment of a tool, as well as fix the issue of the camera clipping through the environment
userInputService = game:GetService("UserInputService") contextActionService = game:GetService("ContextActionService") runService = game:GetService("RunService") player = game:GetService("Players").LocalPlayer camera = game.Workspace.CurrentCamera userInputService.MouseBehavior = Enum.MouseBehavior.LockCenter --Lock mouse to center x, y = 0, 0; function getMouse(name, state, inputObject) x = x + (-inputObject.Delta.x/250) y = y + (-inputObject.Delta.y/250) if y > 5 then --Top camera angle limit y = -5 --Change this as well elseif y < -5 then --Bottom camera angle limit y = -5 --Change this as well end end contextActionService:BindActionToInputTypes("MouseMove",getMouse,false,Enum.UserInputType.MouseMovement) function camUpdate(hrp) hrp.CFrame = CFrame.new(hrp.Position) * CFrame.Angles(0,x,0); end runService.RenderStepped:connect(function() local character = player.Character local hrp = character:FindFirstChild("HumanoidRootPart") if hrp then camUpdate(hrp) camera.Focus = hrp.CFrame * CFrame.new(3,1,0) camera.CFrame = hrp.CFrame * CFrame.new(3,1,12) end end)