Script not working as intended

I’ve made a local script placed in StarterGUI and it is supposed to change the CFrame of workspace.CurrentCamera but when I join the game, the camera is stuck on the ground, not on the camera part.

local Camera = workspace.CurrentCamera

Camera.CameraType = Enum.CameraType.Scriptable

Camera.CameraSubject = workspace.Cam.Position

Camera.CFrame = CFrame.new(workspace.Cam.CFrame)


Currently it is facing at:

What it should face at:

2 Likes

You are setting the Camera’s CFrame at a random part. Change it to the CamPart’s CFrame.

Yes, I did. Forgot to update it. Doesn’t work.

Is there any error in the output?

1 Like

No, no errors in the output.

(30 character)

The part’s LookVector is facing the helicopter?

No, the part’s front is facing the helicopter.

A strange thing is that when I tested the script, the output had error. CameraSubject accepts Instance, not Position, Camera.CFrame only works when it didn’t have CFrame.new(that’s what the error showed).

2 Likes

Those are the same things in this context. You can try manually pointing the camera to the helicopter.

Camera.CFrame = workspace.Cam.CFrame

Fixed the error, but same issue.

image

This is where I look at…

Fixed it, thanks!

( 30 characters )

1 Like