Skip to content

TopdownFocusedLogic ​

Inherits: CameraLogic < Resource

Top-down camera that always follows target No free movement - locked to target position Middle mouse (or right-drag with camera-relative controls) rotates, mouse wheel zooms. Input arrives from the InputManager (uses_input_manager() == true).

Properties ​

floatzoom_speed_damp0.8
floatcamera_x_at_min10.0
floatcamera_x_at_max-20.0
floatsocket_x_at_min-35.0
floatsocket_x_at_max-75.0
boolenable_nameplate_scalingtrue
floatnameplate_scale_min0.6
floatnameplate_scale_max1.2

Variables ​

Node3Dfollow_target
Vector3current_velocityVector3.ZERO
floatcamera_zoom_direction0
floatcamera_x_rotation0.0

Methods ​

voidsetup( cm: CameraController )
voidprocess_camera( delta: float )
booluses_input_manager()
Array[LookBinding]get_look_bindings()
voidhandle_look( kind: LookBinding.Kind, delta_rad: Vector2 )
voidhandle_zoom( steps: int )
voidset_target( target: Variant, use_pan: bool = true )
voidcleanup()
Stringget_type_display_name()
Array[String]validate()

Constants ​

  • float VIEW_ROTATE_FEEL = 0.5 - View rotation relative to free look at the same mouse setting. Top-down rotation was always half the speed of a free orbit (0.1 vs 0.2 degrees per pixel at the default setting).

Property descriptions ​

Zoom Behavior

float zoom_speed_damp = 0.8 ​

Zoom speed damping

Dynamic Camera Angles

float camera_x_at_min = 10.0 ​

Camera X rotation at min zoom

float camera_x_at_max = -20.0 ​

Camera X rotation at max zoom

Socket Rotation

float socket_x_at_min = -35.0 ​

The tilt of the camera socket at the closest zoom, in degrees.

float socket_x_at_max = -75.0 ​

The tilt of the camera socket at the farthest zoom, in degrees.

UI Scaling

bool enable_nameplate_scaling = true ​

True when the nameplates change size with the zoom.

float nameplate_scale_min = 0.6 ​

The size of the nameplates at the closest zoom.

float nameplate_scale_max = 1.2 ​

The size of the nameplates at the farthest zoom.

Variable descriptions ​

Node3D follow_target ​

Runtime state

Vector3 current_velocity = Vector3.ZERO ​

The speed of the camera now.

float camera_zoom_direction = 0 ​

The direction the zoom moves in now.

float camera_x_rotation = 0.0 ​

The tilt of the camera now, in degrees.

Method descriptions ​

void setup( cm: CameraController ) ​

Sets the logic up when it becomes the one in use.

void process_camera( delta: float ) ​

Moves the camera one frame.

bool uses_input_manager() ​

Does the logic get its look input from the input manager?

Array[LookBinding] get_look_bindings() ​

The mouse buttons that turn the view or the character for this logic.

void handle_look( kind: LookBinding.Kind, delta_rad: Vector2 ) ​

Turns the view or the character by the mouse movement.

void handle_zoom( steps: int ) ​

Zooms by the steps of the mouse wheel (positive steps zoom in).

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

Sets what the camera follows. With pan on, it glides there.

void cleanup() ​

Lets go of what the logic holds when it is replaced.

String get_type_display_name() ​

The name of the logic in the editor.

Array[String] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).