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

Camera isn't focusing on a point?

Asked by
Vexture 179
8 years ago

I'm creating a menu and I'm giving the camera something specific to look at. I set its coordinate frame to a certain point and its focus to another (the camera type is scriptable, of course) but it does not focus on the object I specify. The focus is completely unaffacted.

camera.CameraType = Enum.CameraType.Scriptable
camera.CoordinateFrame = workspace:WaitForChild("lobby"):WaitForChild("pos").CFrame
camera.Focus=subject.CFrame

I'm not sure why it isn't focusing. I have also tried CameraSubject on the part I want it to focus on, but the camera still does not focus.

0
What is subject? Where was it defined theCJarmy7 1293 — 8y

1 answer

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
8 years ago

The Scriptable camera does not allow for Focus to be set independent of the Coordinate Frame.

Use the following format for setting Focus on a Scriptable camera:

Given two Vector3 values:

camera.CoordinateFrame = CFrame.new(PositionCameraIS, PositionCameraPoints)

Given two CFrame values:

camera.CoordinateFrame = (CFramePositionIS, CFrameCameraPoints)

So in your case:

camera.CameraType = Enum.CameraType.Scriptable
camera.CoordinateFrame = (workspace:WaitForChild("lobby"):WaitForChild("pos").CFrame, subject.CFrame)
0
Thank you! Vexture 179 — 8y
Ad

Answer this question