Skip to content
Follow Framed Icon

Framed Follow

Enables dynamic framing of a given target using horizontal and vertical dead zones. The dead zones enable the PCam to remain still until the target moves beyond them where the PCam will then resume following.

Previewing the Dead Zone can be done from the Viewfinder panel (3D only for now), which can be found at the bottom of the editor.

Alternatively, enable the Play Viewfinder property in the inspector to show the dead zone while running the game from the editor.

Video Examples

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.

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


Setter

void set_follow_target_node(Node2D target_node)

Example
gdscript
pcam.set_follow_target_node(player_node)
Example
gdscript
pcam.set_follow_target_node(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 Target Offset

Type: Vector2

Default: Vector2(0,0)

Offsets the follow target's position.

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


Setter

void set_follow_target_offset(Vector2 offset)

Example
gdscript
pcam.set_follow_target_offset(Vector2(1, 1))
Example
gdscript
pcam.set_follow_target_offset(Vector3(1, 1, 1))

Getter

Vector2 get_follow_target_offset()

Vector3 get_follow_target_offset()

Example
gdscript
pcam.get_follow_target_offset()
Example
gdscript
pcam.get_follow_target_offset()

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.

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


Setter

void set_follow_has_damping(bool value)

Example
gdscript
pcam.set_follow_has_damping(true)

Getter

bool get_follow_has_damping()

Example
gdscript
pcam.get_follow_has_damping()

Damping Value

Type: float

Default: 10

Defines the damping amount.

Lower value = slower / heavier camera movement.

Higher value = faster / sharper camera movement.

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


Setter

void set_follow_damping_value(float damping_value)

Example
gdscript
pcam.set_follow_damping_value(5)

Getter

float get_follow_damping_value()

Example
gdscript
pcam.get_follow_damping_value()

Distance (3D)

Type: float

Default: 1

Sets a distance offset from the centre of the target. The distance is applied to the PCam's local z axis.

Phantom Camera 3D

This property is for PCam3D only.
The PCam2D alternative to this is can be found in the Zoom section.

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


Setter

void set_follow_distance(float distance)

Example
gdscript
pcam.set_follow_distance(4.2)

Getter

float get_follow_distance()

Example
gdscript
pcam.get_follow_distance()

Dead Zone Horizontal

Type: float

Default: 0

Defines the horizontal dead zone area. While the target is within it, the PCam will not move in the horizontal axis. If the targeted node leaves the horizontal bounds, the PCam will follow the target horizontally to keep it within bounds.

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

Dead Zone Vertical

Type: float

Default: 0

Defines the vertical dead zone area. While the target is within it, the PCam will not move in the vertical axis. If the targeted node leaves the vertical bounds, the PCam will follow vertically to keep it within bounds.

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

Play Viewfinder

Type: bool

Default: false

Enables the dead zones to be visible when running the game from the editor.

Dead zones will never be visible in build exports.

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