CameraSubject not staying after player death

I’m attemping to make the camera subject the Marble part, which is within the character’s model. But, despite my attempts, the camera subject ends up being the Humanoid, typically when you reset and die. This seemingly only happens in the published game- never in studio.
This is my localscript in StarterPlayerScripts:

local camera = workspace.CurrentCamera
repeat task.wait() until game:GetService("Players").LocalPlayer.Character and game:GetService("Players").LocalPlayer.Character.Marble
--
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = game:GetService("Players").LocalPlayer.Character.Marble
--
game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(char)
	repeat task.wait() until game:GetService("Players").LocalPlayer.Character and game:GetService("Players").LocalPlayer.Character.Marble
	camera.CameraSubject = char.Marble
end)

When you want the CameraSubject to be the Marble, the CameraType has to be set to Scriptable, right?

Making it ‘Scriptable’ points the camera at (0,0,0).

You could then set the focus of the camera :slight_smile:
https://create.roblox.com/docs/reference/engine/classes/Camera

I want the camera to follow the marble as if it were a humanoid, though.
This script seems to be working better, and the CameraType isn’t even Scriptable.

game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(char)
	print("new char")
	local camera = workspace.CurrentCamera
	camera.CameraSubject = char:WaitForChild("Marble")
end)```

Would you like to achieve something like this? Help With A Ball Camera Script

Edit: Seems like you found the same thread.

Yep, was able to solve it by using .CharacterAdded. Thanks for the help though.

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