Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can I change the CurrentCamera's CFrame?

Asked by 5 years ago
Edited 5 years ago

So I want the player's camera to go left so the player appears on the right when he click a button, I have made this script, but it's not working, and gives no error,

local Cam = game.Workspace.CurrentCamera
Cam.CFrame = Cam.CFrame + Vector3.new(0,0,4)

It's also in a LocalScript.

0
Make sure to set the CameraType to Scriptable first. mattscy 3725 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

So first, you would have to make the Current camera scriptable:

Cam.CameraType = Enum.CameraType.Scriptable

Then, you would probably still have an error due to you vector. I think this is how you fix the second line of code:

Cam.CFrame = Cam.CFrame + CFrame.new(0,0,4)

Hope this helps

Ad

Answer this question