I want to be able to have full control over the CameraSubject, but it gets reset whenever the player’s character respawns. I have tried setting the Camera back to its previous subject when changed, but this changes the direction and is unreliable.
What do you mean by “disable” the CameraSubject? What exactly are you trying to do with the camera and what is going wrong with this when you respawn?
The camera resets to the player’s humanoid when they spawn, and I want to disable this from happening.
Correct me if I’m wrong, but can’t you just put the script in StarterCharacterScripts so that it persists even after the player died?
The camera will always reset when the player dies, so you will need to set the subject back to the desired part every time they spawn using a LocalScript. As @amadeupworld2 mentioned, putting this script in StarterCharacterScripts would cause it to run every time a new character is loaded (respawned).
This changes the direction of the camera (this was taken after resetting).
Unfortunately, this is not a setting you can simply disable because the camera gets destroyed and recreated every time the character spawns. You could try to manually move the camera back every time the character spawns, but this is rather complicated and required some math knowledge. Technically, the camera will always face the same direction as the front side of the SpawnLocation that they are spawned on, so if you wanted a specific direction every time you spawn just angle the SpawnLocation in that direction.
An idea of how you would do the math, if you want to go that far, is to calculate the difference in CFrame between the character’s head and their camera right before they are respawned (will be hard to get the timing right). Then once they respawn, move the camera relative to that difference in CFrame and you should be back to the previous direction.
A simpler, although still not simple solution, would be to disable BreakJointsOnDeath of all characters when they die, and instead of respawning them you could just teleport them back to spawn (and make a fake body or something) to immitate a death and respawn. As they didn’t die, the camera wasn’t reset so you are facing the same direction. However, I don’t recommend this because you will have to script the entire rest of your game around this quirk that characters never actually die and could cause some problems with existing scripts.
Changing the camera’s type to “Scriptable” makes it not reset