Skip to content
Follow Glued

Glued Follow

Mimics the positional movement of its target.

This is the simplest and lightest of the follow modes and is useful for cases where you just want a camera to follow a target without any additional complications.

Properties

follow_target

Type: Node2D

Default: null

Determines which Node should be followed. The Camera will follow the position of the Follow Target based on the Follow Mode type and its parameters.


Setter

void set_follow_target(Node2D target_node)

Example
gdscript
pcam.set_follow_target(player_node)
Example
gdscript
pcam.set_follow_target(player_node)

Getter

Node2D get_follow_target_node()

Node3D get_follow_target_node()

Example
gdscript
pcam.get_follow_target_node()
Example
gdscript
pcam.get_follow_target_node()

follow_damping

Type: bool

Default: false

Applies a damping effect on the Camera's movement. Leading to heavier / slower camera movement as the targeted node moves around.

This is useful to avoid sharp and rapid camera movement.


Setter

void set_follow_damping(bool enable)

Example
gdscript
pcam.set_follow_damping(true)

Getter

bool get_follow_damping()

Example
gdscript
pcam.get_follow_damping()

damping_value

Type: Vector2

Default: Vector2(0.1, 0.1)

Defines the damping amount. The ideal range should be somewhere between 0-1, likely somewhere around 0.1-0.25.

The damping amount is specified in the individual axis. X and Y for 2D and X, Y and Z for 3D scenes. To have the damping be consistent in all directions, simply supply the same value in all slots.

Lower value = faster / sharper camera movement.
Higher value = slower / heavier camera movement.


Setter

void set_follow_damping_value(Vector2 damping_value)

Example
gdscript
pcam.set_follow_damping_value(Vector2(0.2, 0.2))
Example
gdscript
pcam.set_follow_damping_value(Vector3(0.2, 0.2, 0.2))

Getter

Vector2 get_follow_damping_value()

Vector3 get_follow_damping_value()

Example
gdscript
pcam.get_follow_damping_value()
Example
gdscript
pcam.get_follow_damping_value()

rotate_with_target

Type: bool

Default: false

Makes the PhantomCamera2D copy the rotation of its follow_target This behavior is only available when follow_mode is set and only has one follow_target.

Important

Be sure to disable ignore_rotation on the Camera2D node to enable this feature.

Phantom Camera 2D

This property is for PCam2D only.


Setter

void set_rotate_with_target(bool enable)

Example
gdscript
pcam.set_rotate_with_target(true)

Getter

float get_rotate_with_target()

Example
gdscript
pcam.get_rotate_with_target()

rotation_offset

Type: float

Default: 0

Offsets the rotation when rotate_with_target is enabled.

Phantom Camera 2D

This property is for PCam2D only.


Setter

void set_rotation_offset(float rotation_offset)

Example
gdscript
pcam.set_rotation_offset(42)

Getter

float get_rotation_offset()

Example
gdscript
pcam.get_rotation_offset()

rotation_damping

Type: bool

Default: false

Enables rotational damping when rotate_with_target is enabled.

Phantom Camera 2D

This property is for PCam2D only.


Setter

void set_rotation_damping(bool enable)

Example
gdscript
pcam.set_rotation_damping(true)

Getter

bool get_rotation_damping()

Example
gdscript
pcam.get_rotation_damping()

rotation_damping_value

Type: float

Default: 0.1

Defines the damping amount for the rotate_with_target.

Phantom Camera 2D

This property is for PCam2D only.


Setter

void set_rotation_damping_value(float damping_value)

Example
gdscript
pcam.set_rotation_damping_value(0.42)

Getter

float get_rotation_damping_value()

Example
gdscript
pcam.get_rotation_damping_value()