Characters camera overiding me from a set camera in scripts

I have my character load, and then try set the camera to a set part, however, the camera just stays on the player

function playerAdded(player)
	player:LoadCharacter()
    print('Character loaded')
end
-- LocalScript inside RepFirst
Camera.CameraType = 'Scriptable'
Camera.FieldOfView = 60
Camera.CFrame = CustomiseCamera.CFrame * CFrame.Angles(math.rad(350), 0, 0)
print('Camera set')

The Character loaded prints first, then the Camera set. But even if I was 5 seconds after the character loads, the camera never gets set. What am I missing? If I remove the LoadCharacter then it works, but doesn’t work when the character loads.

1 Like

You may need a WaitForChild() on the camera,it can be a little funky sometimes.
:man_shrugging:

I tried that to no avail. Did more testing however, and even tho the Character is loaded before the camera script is set, if I go

print(Camera.CameraType) inside a loop, it prints Scriptable, then Custom forever. So it’s being changedto custom for some reason

The default CameraScript is likely messing with the camera. Try overwriting it in StarterPlayerScripts and see if that works :slight_smile:

Made no difference :confused:
…

Just to make sure, you named your local script “CameraScript”, and placed it in StarterPlayerScripts, correct? If it’s not named this or its parent isn’t set correctly, then it doesn’t get overwritten.
If you want to make sure its overwritten, check for either a PlayerModule module script, or a local script named CameraScript, and if either exists, then there is still a camera script taking control.

Can you show more of the script? I think it’s very limited.

Why not use: CameraType = Enum.CameraType.Scriptable?

You might also want to set a camerasubject, rather than setting a camera CFrame.

Whopes typo I need to fix that!

Does that cause things to randomly change for no reason?

local Camera = workspace.CurrentCamera

local CustomiseCamera = workspace:WaitForChild('CustomiseCamera')

Camera.CameraType = 'Scriptable'
Camera.FieldOfView = 60
Camera.CFrame = CustomiseCamera.CFrame * CFrame.Angles(math.rad(350), 0, 0)

Image below shows the CustomiseCamera (transculent white part) and the character should spawn inside the black part)


It’s located inside the right spot, named correctly, but when I play I get this

For some reason my part disappears from the game (even tho it’s still there, in the same pos, in workspace), and the character isn’t there (the character model is inside the workspace tho)

But when I remove the above script, I get this


So the player is being tped there and the part is still there.

And also, I cant set the Camera back to the normal settings

Camera.CameraType = 'Custom'
Camera.CameraSubject = Player.Character.Humanoid

Very old topic, but I am experiencing this same issue and I was wondering if there is any easy fix that doesn’t involve completely removing the default camerascript.

3 Likes