Creates a new FollowCamera instance
Unique identifier
VYLO Diob object
Reference to the CameraManager
ProtectedboundsCamera position bounds (Infinity = no limit)
ProtectedcachedCached camera position to avoid object churn
ProtectedcachedCached gizmo position to avoid object churn
ProtectedcachedCached transition position to avoid object churn
VYLO Diob object representing the camera
ReadonlygizmoColor used for gizmo visualization (hex value)
The length of the gizmo line
ReadonlyidUnique identifier for this camera instance
Whether this camera is currently the active view eye
Reference to the CameraManager that owns this camera
ProtectedoperationIf true, this action ignores all time scale (global and camera)
ProtectedoperationPer-action override time scale (temporary), null when not set
The owner/target this camera belongs to (GameInstance or Vector2D) This represents who the camera is attached to or following
Current position of the camera in world space
Previous position of the camera in world space (used for velocity tracking)
The random angle for the gizmo
ProtectedtimeCamera-specific time scale multiplier (1.0 = normal)
Whether to track the target's Z position and subtract it from the Y position. Enabled by default. Useful for 2.5D isometric-style games where height (Z) affects screen Y.
ProtectedtransitionTransition duration for X axis in milliseconds
ProtectedtransitionTransition duration for Y axis in milliseconds
ProtectedtransitionEasing function for X axis transitions
ProtectedtransitionEasing function for Y axis transitions
ProtectedtransitioningWhether this camera is currently transitioning to become the view eye
ProtectedtransitionTransition progress (0-1) when becoming view eye
ProtectedtransitionStarting position for transitions
ProtectedtransitionTarget position for transitions
ProtectedtransitionElapsed time for current transition
ReadonlytypeCamera type identifier
Current velocity of the camera in pixels per second
Getter for gizmoEnabled property
Setter for gizmoEnabled property that notifies CameraManager
Getter for isActive property
Setter for isActive property that notifies CameraManager
Whether to track the view eye's Z position (alias for trackTargetZ)
ProtectedapplyAttaches this camera to a target with optional offsets.
The camera will continuously follow the target's position plus the specified offsets, regardless of whether this camera is the active view eye or not. This ensures all cameras stay synchronized with their targets for seamless transitions. Multiple cameras can attach to the same target with different offsets.
GameInstance or Vector2D to follow
OptionalpOffsets: Partial<CameraOffset>Optional offsets from target position (defaults to {0, 0, 0}) Z-offset is applied as negative Y offset for depth effect
OptionalpOptions: Partial<FollowCameraOptions>// Attach to player at center
camera.attach(player);
// Attach with left shoulder offset
camera.attach(player, { x: -50, y: -20, z: 0 });
// Attach with forward depth offset (positive Z moves camera "up" in 2D)
camera.attach(player, { x: 0, y: 0, z: 30 });
// Attach to static position
camera.attach({ x: 100, y: 200 });
ProtectedclampGets the current camera offsets from the target.
Readonly offsets object with x, y, and z
Gets the owner/target this camera belongs to
The owner or null if not attached to anyone
Gets the current target being followed
The target or null if not attached
ProtectedgetGets the Z value of a target if trackTargetZ is enabled, else returns 0. Used to subtract target height from Y position for 2.5D depth effects.
The target to get Z from
The target's z value, or 0 if tracking is disabled or target has no z
ProtectedgetProtectedgetGets the true camera position for a target (GameInstance or Vector2D) For GameInstance: returns center position (where camera should be) For Vector2D: returns the position directly Reuses cached object to avoid churn
ProtectedisChecks if a target is a Vector2D (has x, y properties but no mapName)
Target to check
True if target is Vector2D, false if GameInstance
Sets this camera as the active view eye and updates diob position immediately
OptionalpOptions: TransitionCameraOptionsSets camera position bounds (Infinity = no limit in that direction)
Minimum X position (use -Infinity for no limit)
Maximum X position (use Infinity for no limit)
Minimum Y position (use -Infinity for no limit)
Maximum Y position (use Infinity for no limit)
Updates the camera's offsets from the target.
Useful for dynamic camera adjustments like aiming or crouching.
X-axis offset
Y-axis offset
Z-axis offset (applied as negative Y offset for depth effect)
Sets the owner/target this camera belongs to
The owner to attach to
Sets transition settings for smooth camera switching
Transition settings with separate axis duration and ease
Protectedupdate
FollowCamera tracks a target (GameInstance or Vector2D) with configurable offsets.
Multiple FollowCameras can attach to the same target, each with different offsets. This enables scenarios like over-the-shoulder cameras, cinematic angles, or multiple viewpoints on the same character.
When the first FollowCamera attaches to a target, a TransitionCamera is automatically created for that target to enable seamless switching between cameras.
Example