Skip to content
ct

Class

GridTargetingState

Generated GDScript class reference for GridPlacement.GridTargetingState.

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.

State for targeting objects within the Grid Building System.

Source: addons/grid_placement/systems/grid_targeting/grid_targeting_state.gd

Syntax

class GridTargetingState extends PlacementResource

Members

NameKindSummary
target_changedSignalEmitted 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_changedSignalEmitted when the node responsible for positioning grid building placement objects and indicators is changed on the PlacementState.
target_map_changedSignalEmitted when the targeted map node is changed. This represents the main target TileMapLayer node on the state.
maps_changedSignalEmitted 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_readyMethod
targetPropertyThe placed node currently being targeted
oldProperty
should_clearProperty
target_3dProperty3D mirror of [member target]. See [method set_manual_target_3d].
positionerPropertyParent node for positioning grid building objects onto the game world.
target_mapPropertyThe 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_3dProperty3D mirror of [member target_map]. Set by the 3D injector /
positioner_3dProperty3D mirror of [member positioner]. The [GridPositioner3D] is
world_facts_provider_2dPropertyOptional game-owned provider for placement-relevant world/physics facts. Kept at targeting state scope so preview, validation, and placement reports can consume one truth source without Grid Placement depending on a physics backend.
mapsPropertyAll 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_sizePropertyTile size property that delegates to the target map's tile set
collision_exclusionsPropertyNodes 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_activePropertyFlag 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().
smooth_world_positionPropertyExact world position for smooth/free placement mode. Updated by the positioner or an external caller when [member PlacementSession.placement_coordinate_mode] is SMOOTH. Grid mode ignores this field.
has_live_smooth_positionPropertyTrue once the positioner has written a real pointer position. Used to distinguish "no pointer data yet" from a legitimate placement at the world origin (0,0), so the host does not flash a preview at the origin before the first mouse motion.
smooth_world_position_3dProperty3D exact world position for smooth/free placement mode. Updated by the 3D positioner when [member PlacementSession.placement_coordinate_mode] is SMOOTH. Grid mode ignores this field.
has_live_smooth_position_3dPropertyTrue once the 3D positioner has written a real pointer position.
clear_collision_exclusionsMethod
set_manual_targetMethod
set_manual_target_3dMethod
clear_manual_targetMethod
set_map_objectsMethod
get_target_map_tile_shapeMethod
get_target_map_tile_setMethod
get_tile_sizeMethod
set_tile_sizeMethod
validate_runtimeMethod
get_ownerMethod
get_owner_rootMethod
get_originMethod
get_editor_issuesMethod
get_runtime_issuesMethod