Log inGet started

camera

The camera namespace — the engine's Luau API reference for camera.

The camera namespace — 4 functions.

globals/camera/active

globals/camera/active() -> string?

Entity id of the on-screen render camera this frame — whichever camera wins the viewport by priority (the editor fly-camera in edit mode, the gameplay camera in play). Render features, billboards, and input bases that must follow the human's on-screen view read this.

globals/camera/editor

globals/camera/editor() -> string?

Entity id of the editor fly-camera (the EditorOnly authoring camera), or nil if the scene has none.

globals/camera/main

globals/camera/main() -> string?

Entity id of the main scene camera — the highest-priority active camera that is NOT the editor fly-camera. The gameplay/PlayerPrototype camera, an agent-placed scene camera, or a cutscene camera. Never the editor camera; nil if the scene has only the editor camera. For the camera currently drawn on screen, use camera.active().

globals/camera/viewData

globals/camera/viewData() -> CameraView?

The active viewport camera's render data this frame: world position, vertical FOV, viewport pixel size, the 6 world-space frustum planes (the same inward-pointing, normalized planes the renderer culls with), and the view-projection matrix. The camera state a render feature needs for camera-relative work — LOD selection, frustum culling, billboards. Render features also get it as ctx.camera.

  • api
  • reference