Camera not applying Subject and Type

My camera only goes back to the players humanoid if I:

  1. Destroy it, then set it to Custom and Humanoid.
    (only if i do this manually)
    my code:
local PlayButton = script.Parent
PlayButton.MouseButton1Click:Connect(function()
	PlayButton.Visible = false
	game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end)

I tried to destroy it originally in the code but i realized that would not work.

I don’t understand? Why would you be destroying your camera? If you want to assign a subject then:

game.Workspace.CurrentCamera.CameraSubject = (gameObject)

Camera subject is set to nil by default

As I said, i was trying to replicate my results by code. If I manually delete it and then set the subject to humanoid and type to custom it works, I have tried just doing that without deleting it but I have to delete it for some reason to get my characters humanoid camera.

Normally, you wouldn’t need to change the camera subject. If the camera type is scriptable, and you want it back to default, just change it to custom on code?

Just don’t delete it.

Well, none of these are even working so that is why I made this post.
Nor am I deleting it anymore in my code.
Changing the CameraSubject does not bring any affect on the code even if i do not have to change it.

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