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.SecondaryActionTrigger | secondary_action_trigger | ControllerLogic.SecondaryActionTrigger.PRESS |
bool | click_to_move | true |
bool | hold_to_move | false |
bool | movement_cancels_cast | true |
bool | auto_face_on_cast | true |
bool | soft_targeting | false |
bool | allow_mouse_interact | true |
bool | allow_keyboard_interact | true |
bool | auto_attack_on_target | false |
Variables ​
Variant | pending_interaction_target | null |
Methods ​
void | setup( pc: PlayerController ) |
void | cleanup() |
void | handle_input_event( event: InputEvent ) |
void | process_input( delta: float ) |
Player | get_current_player() |
Array[LookBinding] | get_look_bindings() |
void | on_click_completed( button_index: int, position: Vector2 ) |
Array[Entity] | get_selected_units() |
void | select_single_player( player: Entity ) |
String | get_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.