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 =,25,0)

local player = game.Players.LocalPlayer

	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 = + offset)
			camera.CFrame =,head.Position)

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