Camera Snapping Directions When Trying to Follow Player?

I’m trying to write code that, if a player touches a death plane, the camera will follow them as they fall. However, sometimes, the camera snaps in another direction if the player ends up falling underneath the camera. Here’s a demonstration of what I mean:

Is there any way of preventing this? I can’t even find anything unusual when I print its LookVector.
Here’s the code I have:

local function TouchPlayer()
	--Kill player
	if debounce == false then
		debounce = true
		local camera =  workspace.CurrentCamera
		local camerapos = camera.CFrame.p
		camera.CameraType = Enum.CameraType.Scriptable
		for i = 1, 80 do --Camera follows player
			camera.CFrame = CFrame.new(camerapos, player.Character.HumanoidRootPart.Position)
			game:GetService("RunService").Heartbeat:Wait()
		end
		ReloadEvent:Fire("deathplane", 0)
		wait(5)
		debounce = false
	end
end
1 Like

This is a problem with roblox lookAt. If you haven’t noticed before, the default roblox camera can’t look more than 80 degrees up or down. This is because lookAt gets really snappy if it look more than 80 degrees up or down. You could make a work around and limit the camera rotation in the x axis (maybe, i might have forgot what rotation axis is for up and down).