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

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.


Setter

void set_tween_on_load(bool enable)

Example
gdscript
pcam.set_tween_on_load(false)

Getter

bool get_tween_on_load()

Example
gdscript
pcam.get_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 InactiveUpdateMode.

Inactive Update ModeValue
ALWAYS0
NEVER1

Setter

void set_inactive_update_mode(int update_mode)

Example
gdscript
pcam.set_inactive_update_mode(InactiveUpdateMode.NEVER)

Getter

int get_inactive_update_mode()

Example
gdscript
pcam.get_inactive_update_mode()

tween_resource

Type: PhantomCameraTween

Default: null

The resource that defines how this PCam should be transitioned to.

Can be shared across multiple PCams.

See the Tween page for more details.


Setter

void set_tween_resource(PhantomCameraTween tween_resource)

Example
gdscript
pcam.set_tween_resource(tween_resource)

Getter

PhantomCameraTween get_tween_resource()

Example
gdscript
pcam.get_tween_resource()

camera_3d_resource

Type: Camera3DResource

Default: null

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

See the Camera3DResource page for more details.


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()

Signals

became_active

Emitted when the PCam becomes active.

became_inactive

Emitted when the PCam becomes inactive.

dead_zone_changed

Emitted when the dead zone changes. Note: This is only applicable in Framed Follow mode.

follow_target_changed

Emitted when the follow target changes.

is_tweening

Emitted when the Camera is being tweened.

look_at_target_changed

Emitted when look_at_target changes.

tween_started

Emitted when the Camera starts to tween to the PCam.

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

Emitted when the Camera completes its tween to the PCam.