Scriptable cameraType breaks player camera?

Hello, I’ll make the explanation quick. So I was trying to make a lock onto a player script whereas when you click ‘L’ or the scroll wheel your camera will lock onto that player’s humanoid root part, however whilst it worked, I wanted to try making it so that the player(the one that locked onto the other player’s humRP) wouldn’t be able to control their camera. So I tried setting the cameraType into scriptable but instead of the player not being able to move their camera, the player’s camera goes up and up continously. Idk why so if anyone can help please do.

Here’s a video example of what happens:
(https://gyazo.com/cdf3d47e67734a40519e722357f03096)

RunService.RenderStepped:Connect(function()
	if Locked or Locked == true then
		if Player ~= nil and Player:FindFirstChildWhichIsA("Humanoid").Health > 1 then
			Camera.CameraType = Enum.CameraType.Scriptable
			Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position+Vector3.new(0,.5,0),Player.HumanoidRootPart.Position)
		else
			Camera.CameraType = Enum.CameraType.Custom
		end
	end
end)

You always get the camera’s cframe position. So it will always add .5 to the camera’s position. So that’s why it still goes on.

1 Like

What should I try doing in order to fix it ? cuz if I remove the additional vector quantities the camera wont move with the player’s character anymore

Try this tutorial out.

1 Like

I found out how to fix it thanks for your responses though!