Skip to content

CameraController ​

Inherits: Node3D

Moves the camera of the player: it holds the current camera logic, the camera socket and the camera, and a remote transform that follows the camera for the mini map and the weather. It sets the camera to a position (with or without a pan), gives the view yaw and zooms the map.

Variables ​

boolcamera_can_processfalse
CameraLogiccurrent_camera_logic
Node3Dcamera_socket
Camera3Dcamera
RemoteTransform3Dminimap_transform
DirectionalLight3Dmini_map_light
RemoteTransform3Dweather_transform
CameraLooklook

Methods ​

voidlegacy_input( event: InputEvent )
voidset_camera_position( target: Variant, use_pan: bool = true )
floatget_view_yaw()
voidcamera_process_off()
voidcamera_process_on()
RemoteTransform3Dget_remote_transform()
voidset_minimap_remote_path( path: NodePath )
voidmap_zoom( direction: int )
RemoteTransform3Dget_weather_transform()
voidset_weather_remote_path( path: NodePath )

Variable descriptions ​

bool camera_can_process = false ​

Camera state

CameraLogic current_camera_logic ​

Camera logic

Node3D camera_socket ​

Node references

Camera3D camera ​

The camera of the player.

RemoteTransform3D minimap_transform ​

The remote transform that moves the mini map camera with the player camera.

DirectionalLight3D mini_map_light ​

The light of the mini map.

RemoteTransform3D weather_transform ​

The remote transform that moves the weather with the player camera.

CameraLook look ​

The look of the screen and the shake of the camera (an effect, an event, a zone or the water asks it): see CameraLook.

Method descriptions ​

void legacy_input( event: InputEvent ) ​

Raw input for camera logics that have NOT been migrated to the InputManager contract (uses_input_manager() == false). Called by InputManager: presses/motion after the GUI, releases before it. Migrated logics get semantic look/zoom calls instead.

void set_camera_position( target: Variant, use_pan: bool = true ) ​

Public interface methods

float get_view_yaw() ​

The yaw the camera is facing (radians, Node3D.rotation.y convention). Read-only.

void camera_process_off() ​

Stops the camera logic from running.

void camera_process_on() ​

Lets the camera logic run.

RemoteTransform3D get_remote_transform() ​

Minimap functionality

void set_minimap_remote_path( path: NodePath ) ​

Sets the node the mini map camera follows.

void map_zoom( direction: int ) ​

Zooms the mini map in or out.

RemoteTransform3D get_weather_transform() ​

Weather functionality

void set_weather_remote_path( path: NodePath ) ​

Sets the node the weather follows.