Having Trouble with Camera Script

Hello, I want to make this Camrea GUI and for some reason it’s just not changing to the player cam instead it’s just staying on the Menu Cam or the CameraPart’s Cframe. Ive Tried to Use the Print debugging method and it says in the Output “Camera Switched” so its running the line of code to make it Switch the camera’s but its not switching.

local camera = game.Workspace.CurrentCamera

function UpdateCamera()
camera.CFrame = game.Workspace.Camera.CFrame
end
game:GetService("RunService").RenderStepped:Connect(UpdateCamera)

script.Parent.MouseButton1Click:Connect(function()
	camera.CameraType = Enum.CameraType.Custom
	script.Parent:Destroy()
	script:Destroy()
end)

Here is a look at the code and output.

Here is where everything is located.
image

If you need more info just lmk, or if you have any clue why this would happen.

iirc you might need to set the camera type to ‘scriptable’ before trying to set the cframe

I thought the same thing but It’s still doing the same thing and I’ve double checked the script so many times I might just do away with the script. Thank you For Trying to help it really means a lot.

I have one more thing to try but if that don’t work than ill just write it all out again or try to make it more Advanced.

Oh try renaming your camera part, there is an object in the workspace called ‘Camera’ by default, so maybe try renaming it to something like Camera_Part

1 Like

Oml you just saved my game from getting deleted turns out it was turning to the Camera in the workspace instead of the Camera Part Like you said. Thank You for Helping Me!!

1 Like

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