I have this issue where the camera or character stutters whenever the player looks around. The weird thing is that it only happens when the camera is set to LockFirstPerson and not classic. Even weirder still is that its the same camera script i used in another game and it works fine over there, but not here (even though i have not edited the script in any way). Any way i can fix this?
here’s the code used:
local function MouseInputLoop()
y += mouse.Value.X/50
x += mouse.Value.Y/50
x = math.clamp(x, math.rad(-80), math.rad(80))
aimRemote:FireServer(x)
end
local function CameraLoop(dt)
inputService.MouseBehavior = Enum.MouseBehavior.LockCenter
--Updates rootPart per frame to point with camera
local cf = CFrame.new(hrp.CFrame.Position)
hrp.CFrame = cf * CFrame.Angles(0, -y, 0)
--Makes torso move up and down based on camera
char.UpperTorso.Waist.C0 = CFrame.new(char.UpperTorso.Waist.C0.Position) * CFrame.Angles(-x, 0, 0)
--moves camera to camera part
camPart.Eyes.C0 = CFrame.new(head.CFrame:ToObjectSpace(hrp.CFrame):Inverse().Position) * char:GetAttribute("CameraOffset")
cam.CFrame = camPart.CFrame * CFrame.Angles(-x, 0, 0)
char.Head.LocalTransparencyModifier = 1
end
runService:BindToRenderStep("CameraLoop", Enum.RenderPriority.Character.Value, CameraLoop)
runService:BindToRenderStep("MouseLoop", Enum.RenderPriority.Camera.Value, MouseInputLoop)
I have already tried moving the function priorities with no results, and i cant keep the camera to Classic since it messes up the character’s movement.