Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Camera isn't focusing on a point?

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.

1 comment

0

What is subject? Where was it defined

1 answer

✓ Accepted answer

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)

1 comment

0

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.