Unable to set camera type to "Scriptable"?

So I have made code that continuously sets the camera type to scriptable until well it gets set to scriptable.
For some reason after it is set it is set back, and no I dont have any scripts that could change it(Its the only script I have in the file)
So uh why is this happening?

-- camera
local camera = workspace.CurrentCamera

repeat 
	task.wait(0.1)
	camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

-- setup camera
warn('go') -- this does get warned
2 Likes

Is it a server script or local script? I don’t think it will work if it is a server script.

1 Like

i had this too, i believe its the PlayerModule resetting the camera type each frame.
the way i fixed it is by spamming
camera.CameraType = Enum.CameraType.Scriptable
a bunch of times every other line in .RenderStepped and left it at that

1 Like

Client
ADadsadasdasdadasdsadsadsad

1 Like

Hmm ok, if this ends up being the only way Ill mark this as the answer

1 Like

Where is the script located? Also, try printing camera.CameraType.

1 Like

Its in starterPlayerScripts, should it be in starterCharacter?

1 Like

This is just a guess but the camera may get reset when the character loads in. Thus, the initial camera change is for the previous camera. Maybe add a wait until the character loads in?

2 Likes

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