Skip to content

Group Look At (3D)

Allows for multiple targets to be looked at. The Pcam3D will create a AABB that surrounds the targets and will look at the centre of it.

Video Example

Properties

look_at_targets

Type: Array[Node3D]

Default: null

Defines the group of targets that the camera should be looking at. It will be looking at the centre of all the assigned targets.


Setter

void set_look_at_targets(Array[Node3D] targets)

void append_look_at_targets(Node3D target)

void append_look_at_targets_array(Array[Node3D] targets)

void erase_look_at_targets(Node3D target)

Example
gdscript
# Assigns a new array of nodes to the Look At Group
pcam.set_look_at_targets(targets)

# Appends one node to the Look At Group
pcam.append_look_at_targets(target)

# Appends an array of nodes to the Look At Group
pcam.append_look_at_targets_array(targets)

# Removes a node from the Look At Group
pcam.erase_look_at_targets(target)

Getter

Array[Node3D] get_look_at_targets()

Example
gdscript
pcam.get_look_at_targets()

look_at_offset

Type: Vector3

Default: null

Offsets the target's Vector3 position that the PCam3D is looking at.


Setter

void set_look_at_offset(Vector3 offset)

Example
gdscript
pcam.set_look_at_offset(Vector3(0.5, 2.5, 0))

Getter

Vector3 get_look_at_offset()

Example
gdscript
pcam.get_look_at_offset()

look_at_damping

Type: bool

Default: false

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

This is useful to avoid sharp and rapid camera rotational movement.


Setter

void set_look_at_damping(bool enable)

Example
gdscript
pcam.set_look_at_damping(true)

Getter

bool get_look_at_damping()

Example
gdscript
pcam.get_look_at_damping()

look_at_damping_value

Type: float

Default: false

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

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


Setter

void set_look_at_damping_value(float damping_value)

Example
gdscript
pcam.set_look_at_damping_value(true)

Getter

float get_look_at_damping_value()

Example
gdscript
pcam.get_look_at_damping_value()