Creates a new CameraManager instance
Each CameraManager instance manages its own cameras and RAF loop. You can create multiple instances for different camera systems.
OptionalpOptions: CameraManagerOptionsConfiguration options for the camera manager
OptionalautoStart?: booleanWhether to automatically start the camera manager
Optionaldebug?: boolean | CameraDebugOptionsDebug gizmos configuration
OptionaldefaultTransition?: TransitionCameraOptionsGlobal default transition options used when switching cameras
Creates a new FollowCamera instance and auto-creates pan/spectate cameras
The created FollowCamera
Creates a new InfluenceCamera instance
Initial X position
Initial Y position
Map name for the camera
The created InfluenceCamera
Creates a new SpectateCamera instance
The created SpectateCamera
Creates a new TransitionCamera instance
The created TransitionCamera
Emits an event to all registered listeners.
Event name
Event payload
Automatically transitions to a FollowCamera and performs the attach action. If already using a FollowCamera for the same target, executes the action directly.
The follow camera instance to use
Target to follow
OptionalpOffsets: CameraOffsetOptional offsets
Gets all cameras managed by this CameraManager
Array of all camera instances
Gets the auto-created spectate camera
The auto spectate camera or null if none exists
Gets the auto-created transition camera
The auto transition camera or null if none exists
Gets a camera by ID
Camera ID
The camera or undefined if not found
Gets cameras of a specific type
Camera type to filter by
Array of cameras of the specified type
Gets the current shake preset name (if any)
Current shake preset name or null
Gets the currently active view eye camera
The current view eye camera or null
Gets current debug options.
Gets the global default transition settings.
Gets the native GizmoRenderer instance if initialized.
Gets the current main follow camera
The main follow camera or null if none set
Gets a shake preset by name
Name of the shake preset
The shake preset configuration or undefined if not found
Handles the end of spectating by a SpectateCamera.
The camera that stopped spectating
Handles the start of spectating by a SpectateCamera.
Cancels any conflicting camera operations (pan, other spectate). Only iterate over relevant camera types.
The camera that started spectating
Handles a request to change the view eye to a new camera.
Called internally by BaseCamera.setAsViewEye(). Automatically performs a smooth transition from the current view eye using default or custom settings, unless pOptions.duration is explicitly set to 0.
The camera to make the new view eye
OptionalpOptions: TransitionCameraOptionsOptional transition settings
Handles when a camera is detached and was the view eye
The camera that was detached
Subscribes a listener to camera system events.
The event name to listen for
The callback function
An unsubscribe function to remove the listener
Automatically transitions to the auto-created PanCamera and performs the pan action. If already using a PanCamera, executes the action directly.
Target to pan to (GameInstance or Vector2D)
OptionalpOptions: PanCameraOptionsPan options (duration, ease, etc.)
Sets global gizmo visibility for all cameras Optimized to use cached gizmo-enabled cameras
Boolean to toggle or detailed options object.
Sets specific debug overlay options.
Partial debug options.
Sets the global default transition settings for camera switches.
Transition configuration
Sets the global base offsets for the view eye
These offsets will be used as the default when shake effects wear off. They provide a way to set a permanent offset for the entire view eye.
X offset in pixels
Y offset in pixels
Sets the main follow camera that will automatically become the view eye when other cameras (spectate, pan) end their operations.
The follow camera to set as main
Target to attach the camera to (GameInstance or Vector2D)
OptionalpOffsets: Partial<CameraOffset>Optional offsets for the camera
OptionalpSetAsViewEye: booleanWhether to immediately set this camera as the view eye
The follow camera for method chaining
Applies custom shake to the active view eye camera
Shake configuration options
Applies a shake preset to the active view eye camera
Name of the shake preset
OptionalpCallback: () => voidOptional callback when shake completes
OptionalpInfiniteOverride: booleanOptional flag to override preset's infinite setting
Automatically transitions to the auto-created SpectateCamera and performs the spectate action. If already using a SpectateCamera, executes the action directly.
Target to spectate (GameInstance or Vector2D)
OptionalpOptions: SpectateCameraOptionsSpectate options (duration, ease, etc.)
Switches from current view eye to target camera smoothly via TransitionCamera. If no view eye is active or duration is 0, switches directly without transition.
The destination camera
OptionalpOptions: TransitionCameraOptionsTransition options (duration, ease, time scale, onComplete)
Promise that resolves when the transition completes
Automatically transitions to an InfluenceCamera at the specified location.
X position for the influence camera
Y position for the influence camera
Map name for the influence camera
Applies zoom to the active view eye camera
OptionalpDestinationLevel: number | { x?: number; y?: number }Target zoom level (number or {x, y} object)
OptionalpDuration: number | DurationSettingsDuration in milliseconds (number or {x, y} object)
OptionalpEase: EaseType | EaseSettingsEasing function (string or {x, y} object)
OptionalpCallback: () => voidOptional callback when zoom completes
OptionalpOptions: { ignoreTimeScale?: boolean; timeScale?: number }
CameraManager is the central singleton that manages all camera instances in the Lens system.
Responsibilities:
The CameraManager can operate in two modes:
Example