Skip to content

Class

PlaceModeMachine

Generated GDScript class reference for GridPlacement.PlaceModeMachine.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

Manages placement mode state as a proper state machine. Replaces the overlapping BuildMode and PlaceSubmode enums, eliminating the mode-flap bug class caused by inconsistent state combinations and the "no place-pending value" hack. [b]States:[/b] IDLE — Not placing anything. Maps to ModeState.OFF ROUTER — PLACE mode active, waiting for tool/category selection OBJECT — Actively placing an object (placeable selected) TERRAIN — Actively painting terrain (terrain name selected) [b]Two-way sync with ModeState:[/b] Out: IDLE → OFF, all others → PLACE (canonical) In: non-PLACE/BUILD modes force IDLE (MOVE/DEMOLISH/INFO/OFF) Scene-free (extends RefCounted). Directly unit-testable.

Source: addons/grid_placement/systems/building/place_mode_machine.gd

Syntax

class PlaceModeMachine extends RefCounted

Members

NameKindSummary
state_changedSignalPlacement mode states. Emitted when placement state changes.
current_stateProperty
set_mode_stateMethod
enter_idleMethod
enter_routerMethod
enter_objectMethod
enter_terrainMethod
is_activeMethod
is_routerMethod
is_placing_objectMethod
is_painting_terrainMethod