Open Asterune
Camera

Camera

Defines the viewpoint used to render the scene on a client.

Creatable
Instance.new("Camera")
Inherits
Instance
Replication
Standard

Behavior

Camera defines the client viewpoint. Access the active camera through workspace.CurrentCamera in a LocalScript.

Set CameraType to Scriptable before controlling CFrame. Other camera modes update the transform automatically.

Summary

Members26
Properties13
Methods12
Events1

Properties

CFrame

Camera.CFrame: CFrame = CFrame.new(0, 0, 0)

The camera position and orientation in world space. Automatic camera modes may overwrite assigned values on the next frame.

CameraSubject

Camera.CameraSubject: Instance? = nil

The instance followed by automatic camera modes, normally the character's Humanoid. Ignored in Scriptable mode.

CameraType

The camera control mode. Scriptable uses the transform supplied by scripts. The current native controller treats the other stored modes as automatic camera control; assigning their names does not select separate tracking implementations.

CoordinateFrame

Camera.CoordinateFrame: CFrame

Compatibility spelling of CFrame. Use CFrame in new code.

CullingMask

Camera.CullingMask: number = 4294967295

Bit mask selecting which geometry visibility layers the camera renders.

FieldOfView

Camera.FieldOfView: number = 70

The vertical field of view, in degrees.

Focus

Camera.Focus: CFrame = CFrame.new(0, 0, 0)

The reference frame used for level-of-detail and lighting calculations.

HeadLocked

Camera.HeadLocked: boolean = true

Whether the rendered camera includes tracked head movement.

NearClip

Camera.NearClip: number = 0.05

The distance of the near clipping plane from the camera.

OrthographicSize

Camera.OrthographicSize: number = 50

The view size used for orthographic projection.

ProjectionType

Whether the camera uses perspective or orthographic projection.

ViewDistance

Camera.ViewDistance: number = 2000

The maximum rendering distance from the camera.

ViewportSize

Camera.ViewportSize: Vector2 = Vector2.new(0, 0)

The read-only dimensions of the rendered viewport, in pixels.

Methods

GetExecutionGroup

Camera:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetProjectionMatrix

Camera:GetProjectionMatrix(): { number }

Returns the camera's projection matrix as a numeric array.

GetRenderCFrame

Camera:GetRenderCFrame(): CFrame

Returns the camera transform used for rendering. It may differ from CFrame during interpolation.

GetRoll

Camera:GetRoll(): number

Returns the camera's roll angle in radians.

Interpolate

Camera:Interpolate(endPos: CFrame, endFocus: CFrame, duration: number): ()

Interpolates the camera transform and focus toward the supplied endpoints over duration seconds.

ScreenPointToRay

Camera:ScreenPointToRay(x: number, y: number, depth: number?): Ray

Returns a Ray through a screen position, accounting for the interface inset.

SetProjectionMatrix

Camera:SetProjectionMatrix(matrix: { number }?): ()

Sets a custom projection matrix. Passing nil restores the standard projection.

SetRoll

Camera:SetRoll(rollAngle: number): ()

Sets the camera's roll angle in radians.

StopInterpolation

Camera:StopInterpolation(): ()

Stops the camera's active interpolation.

ViewportPointToRay

Camera:ViewportPointToRay(x: number, y: number, depth: number?): Ray

Returns a ray through a viewport position without applying the interface inset.

WorldToScreenPoint

Camera:WorldToScreenPoint(worldPoint: Vector3): (Vector3, boolean)

Projects a world position into screen coordinates and reports whether it is on screen.

WorldToViewportPoint

Camera:WorldToViewportPoint(worldPoint: Vector3): (Vector3, boolean)

Projects a world position into viewport coordinates and reports whether it is within the viewport.

Events

InterpolationFinished

Camera.InterpolationFinished: RBXScriptSignal

Fires when the camera interpolation finishes.

Inherited members

Inherited47

Example

Luau
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(0, 10, 20)

Workspace · CFrame · Enum.CameraType · LocalScript