Skip to content
ct

Class

PlacementState

Generated GDScript class reference for GridPlacement.PlacementState.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

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 RefCounted

Members

NameKindSummary
action_performedSignalEmitted when a placement action is performed (success or failure). Consolidated signal replacing [signal success] and [signal failed] for new consumers. Compat shim: [signal success] and [signal failed] are still emitted for 5.1.0.
successSignalEmitted when an object is successfully placed into the game world. @deprecated Prefer [signal action_performed] for new connections.
failedSignalEmitted when a placement action fails. @deprecated Prefer [signal action_performed] for new connections.
preview_changedSignalEmitted when the build preview instance changes.
placed_parent_changedSignalEmitted when the parent node for placed objects changes.
system_changedSignalEmitted when the connected placement system changes (currently unused).
pre_instance_addedSignalEmitted 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_paintSignalEmitted before a terrain tile is painted. Listeners can inspect the paint data or call veto().
post_terrain_paintSignalEmitted after a terrain tile is painted successfully.
post_terrain_removedSignalEmitted after a terrain tile is erased. Listeners (like refunders) can inspect the paint data which carries the terrain name that was removed.
pre_terrain_demolishSignalEmitted 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_demolishSignalEmitted after terrain is demolished successfully (5.1.0-P).
placed_parentPropertyThe parent node where objects are placed during build mode.
previewPropertyThe current preview object in build mode, moving with the mouse until placed.
set_manipulation_stateMethod
get_ownerMethod
get_editor_issuesMethod
get_runtime_issuesMethod