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

How do I make the camera go to a certain position/point?

Asked by 9 years ago

I have tried this:

game.Workspace.Camera.CameraType = ("Scriptable");
game.Workspace.Camera.CoordinateFrame = CFrame.new(-413.876099, -67.1133957, 15.660181, 0.447752953, -0.813180864, 0.371825784, -0, 0.415839374, 0.909438133, -0.89415741, -0.407203615, 0.186193272);

Is this correct? It yields no effects.

I use :

print(game.Workspace.CurrentCamera.CoordinateFrame); 

to get the coordinate/point of this camera position however it doesn't seem to change to that position?

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

Your problem is that you're trying to change the camera by accessing the Camera child of workspace. You need to access the CurrentCamera. - As this is the actual object that controls the client's camera.

Things to note ~ You can only edit the CurrentCamera from the client, e.g. a localscript.

local cam = workspace.CurrentCamera
local pos = CFrame.new(-413.876099, -67.1133957, 15.660181, 0.447752953, -0.813180864, 0.371825784, -0, 0.415839374, 0.909438133, -0.89415741, -0.407203615, 0.186193272)

cam.CameraType = ("Scriptable")
cam.CoordinateFrame = pos
0
It's still not setting it. I don't know why! Arithmeticity 167 — 9y
Ad

Answer this question