Manages communication between the placement system and connected objects during gameplay. Emits signals for placement actions, previews, and state changes to coordinate placement. Validates readiness when the tile map is set, requiring all properties to be assigned in the same frame.
Source: addons/grid_placement/systems/building/placement_state.gd
Syntax
class PlacementState extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
action_performed | Signal | Emitted when a placement action is performed (success or failure). Read success/failure from [member PlacementActionData.report]. |
preview_changed | Signal | Emitted when the build preview instance changes. |
placed_parent_changed | Signal | Emitted when the parent node for placed objects changes. |
system_changed | Signal | Emitted when the connected placement system changes (currently unused). |
pre_instance_added | Signal | Emitted after the scene is instantiated but before it is added to the scene tree. Allows external code to configure the instance (set properties, attach scripts, etc.) before _ready() runs. |
pre_terrain_paint | Signal | Emitted before a terrain tile is painted. Listeners can inspect the paint data or call veto(). |
post_terrain_paint | Signal | Emitted after a terrain tile is painted successfully. |
post_terrain_removed | Signal | Emitted after a terrain tile is erased. Listeners (like refunders) can inspect the paint data which carries the terrain name that was removed. |
pre_terrain_demolish | Signal | Emitted before terrain is demolished (5.1.0-P). Listeners can inspect the [TerrainDemolishData] or call [method TerrainDemolishData.veto] to cancel. This is the terrain analogue of [signal ManipulationState.pre_demolish]. |
post_terrain_demolish | Signal | Emitted after terrain is demolished successfully (5.1.0-P). |
placed_parent | Property | The parent node where objects are placed during build mode. |
preview | Property | The current preview object in build mode, moving with the mouse until placed. |
set_manipulation_state | Method | |
notify_terrain_demolish | Method | |
get_owner | Method | |
get_editor_issues | Method | |
get_runtime_issues | Method |