Player instantly dies when hitting floor

I wrote a script that places your camera above your head, when thats enabled as soon as the player hits the floor they die, when its disabled they don’t

camera script:

local rs = game:GetService("RunService")

local camera = workspace.CurrentCamera
local offset = Vector3.new(0,25,0)

local player = game.Players.LocalPlayer

rs.RenderStepped:connect(function()
	if player.Character then
		if player.Character:FindFirstChild("Head") then
			camera.CameraSubject = nil
			camera.CameraType = Enum.CameraType.Scriptable
			local head = player.Character:FindFirstChild("Head")
			camera.CFrame = CFrame.new(head.Position + offset)
			camera.CFrame = CFrame.new(camera.CFrame.Position,head.Position)
		end
	end
end)

Thanks in advance.

I don’t know why this happens but could you try moving the line camera.CameraType to be before camera.CameraSubject

I tried it without camera subject before

UPDATE: I changed the value to below 25 and it works fine now apparently roblox just hates the number 25