Skip to content

PointAndClickSingleLogic ​

Inherits: ControllerLogic < Resource

Point-and-click single-character controller Left-click: Select entities/move Right-click: Issue commands Tab: Cycle through party members

Description ​

UPDATED: Now uses direct process_interaction() calls instead of interact_with_target() This matches the WASD controller pattern for consistency

Properties ​

ControllerLogic.SecondaryActionTriggersecondary_action_triggerControllerLogic.SecondaryActionTrigger.PRESS
boolclick_to_movetrue
boolhold_to_movefalse
boolmovement_cancels_casttrue
boolauto_face_on_casttrue
boolsoft_targetingfalse
boolallow_mouse_interacttrue
boolallow_keyboard_interacttrue
boolauto_attack_on_targetfalse

Variables ​

Variantpending_interaction_targetnull

Methods ​

voidsetup( pc: PlayerController )
voidcleanup()
voidhandle_input_event( event: InputEvent )
voidprocess_input( delta: float )
Playerget_current_player()
Array[LookBinding]get_look_bindings()
voidon_click_completed( button_index: int, position: Vector2 )
Array[Entity]get_selected_units()
voidselect_single_player( player: Entity )
Stringget_type_display_name()

Property descriptions ​

Single Player Movement

ControllerLogic.SecondaryActionTrigger secondary_action_trigger = ControllerLogic.SecondaryActionTrigger.PRESS ​

When the right-click command fires. RELEASE_WITHOUT_DRAG lets a camera that uses right-drag to look (e.g. third-person) tell "click to command" from "drag to look".

bool click_to_move = true ​

Click terrain to move there

bool hold_to_move = false ​

Hold to continuous pathfind to cursor

bool movement_cancels_cast = true ​

Moving cancels active casts

Single Player Targeting

bool auto_face_on_cast = true ​

Face target when casting

bool soft_targeting = false ​

Soft targeting (hover = target, doesn't lock)

Interaction

bool allow_mouse_interact = true ​

Allow mouse-click interactions

bool allow_keyboard_interact = true ​

Allow keyboard (E/F) interactions

Combat

bool auto_attack_on_target = false ​

Auto-attack when target selected

Variable descriptions ​

Variant pending_interaction_target = null ​

Runtime state (not exported)

Method descriptions ​

void setup( pc: PlayerController ) ​

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

void cleanup() ​

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

void handle_input_event( event: InputEvent ) ​

Handles one input event (a click, a key).

void process_input( delta: float ) ​

Handles the input of one frame.

Player get_current_player() ​

The player the logic controls now.

Array[LookBinding] get_look_bindings() ​

With RELEASE_WITHOUT_DRAG: report a right-click only if the pointer was not dragged (a camera that uses right-drag to look then waits for the drag instead of starting at the press)

void on_click_completed( button_index: int, position: Vector2 ) ​

Called when a click ends (the button and the place on the screen).

Array[Entity] get_selected_units() ​

The entities the player has selected.

void select_single_player( player: Entity ) ​

Selects one player.

String get_type_display_name() ​

The name of the logic in the editor.