Camera will not change properties via scripts

You can write your topic however you want, but you need to answer these questions:

  1. What do I want to achieve?
    I want the Camera to change its CFrame to the CFrame of a part.
    Here is the script
    local Cam = workspace.CurrentCamera
    	print("Ready")
    	Cam.CameraSubject = nil
    	Cam.CameraType = Enum.CameraType.Scriptable
    	Cam.CFrame = workspace.CameraStand.CFrame

  1. What is the issue?
    Nothing is changing

  2. What solutions have I tried so far?
    I have tried to Debug everything, put it server sided but nothing is working.

Is this a local script? If so, where is it placed?

It is placed under StarterPlayerScripts

Did you rename the Camera object in workspace to “CurrentCamera”, because the default name is simply “Camera”

I am not sure if this is the most efficient way, but I remember fixing this issue by doing:

repeat 
wait()
Cam.CameraType = Enum.CameraType.Scriptable
until Cam.CameraType == Enum.CameraType.Scriptable

CurrentCamera and Camera are the same thing

They are? I don’t see any CurrentCamera object.

Keep in mind, you can’t set CameraSubject to nil. You need to set it your object.

1 Like

They are, workspace.Camera can be declared as workspace.CurrentCamera

“CurrentCamera” is a property of workspace which the client can use to access their camera. It’s used to find the camera object of the local player.

1 Like

As @Xx_FROSTBITExX said, you cannot set the CameraSubject to nil. Try changing it to a part in your character, or changing it to an invisible part to re-enact the camera being nil

1 Like