Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.
State for targeting objects within the Grid Building System.
Source: addons/grid_placement/systems/grid_targeting/grid_targeting_state.gd
Syntax
class GridTargetingState extends PlacementResourceMembers
| Name | Kind | Summary |
|---|---|---|
target_changed | Event | Emitted when the readiness status of the state has changed - usually after successful validation. Emitted when the target node for the state is changed. NOTE: Typically target is set by a TargetingShapeCast2D or similar casting node from the runtime scene |
positioner_changed | Event | Emitted when the node responsible for positioning grid building placement objects and indicators is changed on the PlacementState. |
target_map_changed | Event | Emitted when the targeted map node is changed. This represents the main target TileMapLayer node on the state. |
maps_changed | Event | Emitted when the list of known maps is changed.[br][br] This is a list of maps that can be accessed without the need for any collision check calls. |
is_ready | Method | |
target | Property | The placed node currently being targeted |
old | Property | |
should_clear | Property | |
target_3d | Property | 3D mirror of [member target]. See [method set_manual_target_3d]. |
positioner | Property | Parent node for positioning grid building objects onto the game world. |
target_map | Property | The TileMapLayer or TileMap node to be used when determining grid distances in your game world [br][br] You could think of this as the main map node usually where characters stand on |
target_map_3d | Property | 3D mirror of [member target_map]. Set by the 3D injector / |
positioner_3d | Property | 3D mirror of [member positioner]. The [GridPositioner3D] is |
maps | Property | All maps to be known by the targeting state for testing against without casting for collisions. [br][br] You can exclude any purely cosmetic maps that shouldn't have gameplay impacts. |
tile_size | Property | Tile size property that delegates to the target map's tile set |
collision_exclusions | Property | Nodes that should be excluded from collision detection during indicator validation. This is primarily used during manipulation move operations to exclude the original object being moved, so indicators only detect collisions with OTHER objects. **IMPORTANT**: This list is automatically cleared when: - The target changes (manipulation ends and switches to a different target) - Manually calling clear_collision_exclusions() **Usage**: Set this at the start of manipulation move operations and it will auto-clear when manipulation ends. |
is_manual_targeting_active | Property | Flag indicating whether manual targeting mode is currently active. When true, automatic targeting systems (like TargetingShapeCast2D) will not overwrite the manually-set target, and collision_exclusions will persist across target updates. Used during BUILD mode (preview) and MOVE mode (manipulation copy). Set via set_manual_target() and cleared via clear_manual_target(). |
clear_collision_exclusions | Method | |
set_manual_target | Method | |
set_manual_target_3d | Method | |
clear_manual_target | Method | |
set_map_objects | Method | |
get_target_map_tile_shape | Method | |
tile_set | Property | |
get_target_map_tile_set | Method | |
get_tile_size | Method | |
tile_set | Property | |
set_tile_size | Method | |
tile_set | Property | |
validate_runtime | Method | |
issues | Property | |
get_owner | Method | |
get_owner_root | Method | |
get_origin | Method | |
get_editor_issues | Method | |
issues | Property | |
get_runtime_issues | Method | |
issues | Property | |
issues | Property | |
issues | Property | |
current | Property |
Source
addons/grid_placement/systems/grid_targeting/grid_targeting_state.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs