Skip to content

Look At Overview (3D) ​

Determines the rotational logic for a given PCam3D.

The different modes has different functionalities and purposes, so choosing the correct mode depends on what each PCam is meant to do.

Core Modes ​

image alt

Mimic​

The simplest of the available options. Effectively copies the rotational value of the targeted Node3D.

image alt

Simple​

Keeps a persistent forward direction towards a target.

image alt

Group​

Allows for multiple targets to be looked at. The camera will look at the centre of the assigned targets' Vector3 coordinate.

Properties ​

look_at_mode ​

Type: LookAtEnum

Default: None

Value is based on LookAtMode enum.

Look At ModeValue
NONE0
MIMIC1
SIMPLE2
GROUP3

Important

This property should not be changed during runtime, as such the setter for this has purposely been excluded.

To use another look_at_mode at runtime, switch to a separate PCam with the specific look_at_mode applied.


Getter ​

int get_look_at_mode()

Example
gdscript
pcam.get_look_at_mode()

up ​

Type: Vector3

Default: Vector3(0, 1, 0)

Defines the upward direction of the PhantomCamera3D when look_at_mode is set.

This value will be overriden if up_target is defined.


Setter ​

void set_up(Vector3 value)

Example
gdscript
pcam.set_up(Vector3(1, 1, 0))

Getter ​

Vector3 get_up()

Example
gdscript
pcam.get_up()

up_target ​

Type: Node3D

Default: null

Applies and continuously updates the up direction of the PhantomCamera3D based on this target when look_at_mode is set.

Setting a value here will override the up value.


Setter ​

void set_up_target(Node3D value)

Example
gdscript
pcam.set_up_target(node_target)

Getter ​

Node3D get_up_target()

Example
gdscript
pcam.get_up_target()

look_at_lookahead ​

Type: bool

Default: false

Enables velocity-based look-ahead. As the look at target moves the camera will move further ahead based on its velocity. The faster the look at target moves, the further ahead the camera will look.


Setter ​

void set_look_at_lookahead(bool value)

Example
gdscript
pcam.set_look_at_lookahead(true)

Getter ​

bool get_look_at_lookahead()

Example
gdscript
pcam.get_look_at_lookahead()

look_at_lookahead_time ​

Type: float

Default: 0.1

The amount of seconds to look ahead of the follow target's position per axis based on the follow target's velocity.


Setter ​

void set_look_at_lookahead_time(float value)

Example
gdscript
pcam.set_look_at_lookahead_time(0.5)

Getter ​

float get_look_at_lookahead_time()

Example
gdscript
pcam.get_look_at_lookahead_time()

look_at_lookahead_acceleration ​

Type: float

Default: 0.1

Determines the damping speed of how fast the camera should reach the look_at_lookahead_time target once the look_at target has positional velocity.

Lower value = faster
Higher value = slower


Setter ​

void set_look_at_lookahead_acceleration(float value)

Example
gdscript
pcam.set_look_at_lookahead_acceleration(0.5)

Getter ​

float get_look_at_lookahead_acceleration()

Example
gdscript
pcam.get_look_at_lookahead_acceleration()

look_at_lookahead_deacceleration ​

Type: float

Default: 0.1

Determines the damping speed of how fast the camera should decelerate back to the follow target's position once it has no positional velocity.

Lower value = faster
Higher value = slower


Setter ​

void set_look_at_lookahead_deacceleration(float value)

Example
gdscript
pcam.set_look_at_lookahead_deacceleration(0.5)

Getter ​

float get_look_at_lookahead_deacceleration()

Example
gdscript
pcam.get_look_at_lookahead_deacceleration()

look_at_lookahead_max ​

Type: bool

Default: false

Enables a maximum velocity limit in meters per second for look_at_lookahead.

If true, the look at target's velocity will be clamped to the look_at_lookahead_max_value.

In other words, no matter how fast the target's actual velocity is, the lookahead will only follow up to the speed defined here.


Setter ​

void set_look_at_lookahead_max(bool value)

Example
gdscript
pcam.set_look_at_lookahead_max(true)

Getter ​

bool get_look_at_lookahead_max()

Example
gdscript
pcam.get_look_at_lookahead_max()

look_at_lookahead_max_value ​

Type: float

Default: 5

The maximum look_at_lookahead velocity in meters per second that will be tracked.


Setter ​

void set_look_at_lookahead_max_value(float value)

Example
gdscript
pcam.set_look_at_lookahead_max_value(10)

Getter ​

float get_look_at_lookahead_max_value()

Example
gdscript
pcam.get_look_at_lookahead_max()

Methods ​

bool is_looking ​

Returns true if look_at_mode is not set to NONE and has a valid look_at_target.

Example
gdscript
pcam.is_looking()

Made with ♥ in Vitepress