Skip to content

PhantomCamera3D

Inherits: Node3D

PhantomCamera3D, shortened to PCam3D (text) and pcam_3d (code), is used in 3D scenes.

Core Properties

image alt

Priority

Determines which PCam3D should be controlling the Camera3D.

image alt

Follow Mode

Enables the PCam3D to follow specific target(s) using various logics.

image alt

Look At

Enables the PCam3D to look at specific node(s), effectively adjusting its rotational value.

image alt

Tween

Determines how the Camera3D should tween to this PhantomCamera3D upon becoming active.

Secondary Properties

Active State

Type: bool

Default: false

Returns true if this PCam is the one controlling the scene's Camera.


Getter

bool is_active()

Example
gdscript
pcam.is_active()

Tween on Load

Type: bool

Default: true

By default, the moment a PCam is instantiated into a scene, and has the highest priority, it will perform its tween transition.

This is most obvious if a PCam has a long duration and is attached to a playable character that can be moved the moment a scene is loaded.

Disabling the Tween on Load property will disable this behaviour and skip the tweening entirely when instantiated.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_tween_on_load(bool value)

Example
gdscript
pcam.set_tween_on_load(false)

Getter

bool is_tween_on_load()

Example
gdscript
pcam.is_tween_on_load()

Inactive Update Mode

Type: int

Default: 0

Determines how often an inactive PCam should update its positional and rotational values. This is meant to reduce the amount of calculations inactive PCams are doing when idling to improve performance. The value is based on the enum type Constants.InactiveUpdateMode.

Inactive Update ModeValue
ALWAYS0
NEVER1

Getter

string get_inactive_update_mode()

Example
gdscript
pcam.get_inactive_update_mode()

Note: This property is only modifiable within the node's inspector panel in the editor.

Camera3D Resource

Type: Camera3DResource

Default: null

A resource type that allows for overriding the Camera3D node's properties.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_camera_3D_resource(Camera3DResource resource)

Example
gdscript
pcam.set_camera_3D_resource(resource)

Getter

Camera3DResource get_camera_3D_resource()

Example
gdscript
pcam.get_camera_3D_resource()

Camera Cull Mask

Type: int

Default: 1048575

Overrides the Camera Cull Mask property of the Camera3D once becoming active.

A simplified helper setter method can be found in the example code below.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_camera_cull_mask(int cull_mask)

Example
gdscript
pcam.set_camera_cull_mask(cull_mask)

# Use this helper method to enable or disable a specific layer.
pcam.set_cull_mask_value(int layer_number, bool value)

Getter

int get_camera_cull_mask()

Example
gdscript
pcam.get_camera_cull_mask()

H Offset

Type: float

Default: 0

Overrides the H Offset property of the Camera3D once becoming active.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_camera_h_offset(float h_offset)

Example
gdscript
pcam.set_camera_h_offset(4.2)

Getter

int get_camera_h_offset()

Example
gdscript
pcam.get_camera_h_offset()

V Offset

Type: float

Default: 0

Overrides the V Offset property of the Camera3D once becoming active.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_camera_v_offset(float v_offset)

Example
gdscript
pcam.set_camera_v_offset(4.2)

Getter

int get_camera_v_offset()

Example
gdscript
pcam.get_camera_v_offset()

FOV

Type: float

Default: 75

Overrides the FOV (Field of View) property of the Camera3D once becoming active.

Note: During runtime, properties should be modified and read via their setters & getters respectively.


Setter

void set_camera_fov(float fov)

Example
gdscript
pcam.set_camera_fov(4.2)

Getter

int get_camera_fov()

Example
gdscript
pcam.get_camera_fov()

Signals

Became Active

Signal

became_active

Emitted when the PCam becomes active.

Became Inactive

Signal

became_inactive

Emitted when the PCam becomes inactive.

Follow Target Changed

Signal

follow_target_changed

Emitted when the follow target changes.

Tween Started

Signal

tween_started

Emitted when the Camera starts to tween to the PCam.

Is Tweening

Signal

is_tweening

Emitted when the Camera is being tweened.

Tween Interrupted

Signal

tween_interrupted (PhantomCamera pcam)

Emitted when the tween is interrupted due to another PCam becoming active.

The argument is the PCam that interrupted the tween.

Tween Completed

Signal

tween_completed

Emitted when the Camera completes its tween to the PCam.