How do make this death screen?

I wanna to code a script that freeze the camera and only facing to the player at death like this video

idk how to code that so uh… can someone pls answer.

thanks :D.

2 Likes

Set the cameraType to Scriptable, then Lerp the camera’s LookAt vector, not the Position vector, towards the player as an animation plays (or the player just falling/dying).

That’d be in RunService or another thing that runs each frame. It’d also be in a local script.

local script in StarterCharacterScript

local Camera = workspace.CurrentCamera
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid", 60)
local Root = Character:WaitForChild("HumanoidRootPart", 60)

Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = Humanoid

Humanoid.Died:Connect(function()
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CameraSubject = nil

	repeat task.wait()
		Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Root.Position)
	until Character == nil
end)

You shouldn’t write entire scripts for people. I’d at least explain what it does.

This function listens for when the player dies (Humanoid.Died:Connect(...)) and sets the camera’s CameraType to Scriptable. This lets you control it how you want. Then, CameraSubject is set to nil, to stop it from following the player. I believe this actually unnecessary, as Scriptable does that. Then, we repeat ... until the player’s character is equal to nil. This will happen when the player respawns, as the reference to the character will be nil (it’s a different Model once you respawn). During the loop, the camera looks at the player.

1 Like

It’s been years since I stopped explaining things, because most people who ask for help on the forum are only looking for working code and rarely take the time to read our explanations, they mark the first working post as solution and ignore everything else.

3 Likes

I understand that completely.

With how people act (and how people prove their lack of knowledge), I’m on the verge of just not helping people anymore.

1 Like

IT WORK! thanks for the script, now i can add fling on death to the player :D.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.