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 | Signal | Typically target is set by a TargetingShapeCast2D or similar casting node at runtime. |
target_changed_3d | Signal | 3D mirror of [signal target_changed]: the host sets [member target_3d] from positioner-cell resolution since 3D placeables carry no physics. |
positioner_changed | Signal | Emitted when the positioner node changes. |
target_map_changed | Signal | Emitted when the main target TileMapLayer changes. |
maps_changed | Signal | Emitted when the known-maps list changes (maps usable without collision checks). |
is_ready | Method | |
target | Property | Targeted node. |
old | Property | |
should_clear | Property | |
target_3d | Property | 3D mirror of [member target]. See [method set_manual_target_3d]. |
old | Property | |
should_clear | Property | |
positioner | Property | Parent node that positions grid building objects in the world. |
target_map | Property | Main map used for grid distances, usually where characters stand. |
fallback | Property | |
target_map_3d | Property | 3D mirror of [member target_map], typed [GridMap] so the 3D service needs no casts; 2D users never touch it. |
positioner_3d | Property | 3D mirror of [member positioner], kept separate so 2D positioners (cast to Node2D) keep their type. |
world_facts_provider_2d | Property | Optional world/physics facts provider so preview, validation, and reports share one truth source without depending on a physics backend. |
maps | Property | All maps known to the targeting state. Optional for single-layer levels: empty falls back to [member target_map]. List every gameplay-relevant layer once the level uses more than one; cosmetic maps can be excluded. |
tile_size | Property | Tile size property that delegates to the target map's tile set |
collision_exclusions | Property | Nodes excluded from indicator collision validation, primarily the original object during a manipulation move. Auto-cleared when the target changes; set at the start of the move and left to auto-clear when it ends. |
is_manual_targeting_active | Property | Manual targeting mode: automatic targeting systems will not overwrite the target and collision exclusions persist across updates. Used during BUILD (preview) and MOVE (manipulation copy); set via set_manual_target(), cleared via clear_manual_target(). |
smooth_world_position | Property | Exact world position for SMOOTH placement mode, updated by the positioner or an external caller; grid mode ignores it. |
has_live_smooth_position | Property | True once the positioner wrote a real pointer position, distinguishing "no data yet" from a legitimate origin placement so the host does not flash a preview at (0,0). |
smooth_world_position_3d | Property | 3D exact world position for SMOOTH placement mode; grid mode ignores it. |
has_live_smooth_position_3d | Property | True once the 3D positioner has written a real pointer position. |
pick_ray_origin_3d | Property | World-space pointer ray of the latest 3D hover, mirrored from the spike by the positioner. Hover identity resolves the record this ray hit. |
pick_ray_dir_3d | Property | |
has_live_pick_ray_3d | Property | True once the 3D positioner wrote a real pointer ray. Keyboard nav and session rebinds clear it, so click-time acquisition never answers from a ray that predates the positioner cell. |
last_click_missed_3d | Property | True when the latest 3D click raycast missed the grid (sky/void click). Set by the positioner's click branch alongside the ray publish; consumed (read + cleared) by click-time acquisition so a sky click finds no target instead of acting on the stale hover cell. Defaults false so headless/tests without clicks keep the legacy behavior. |
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 | |
get_target_map_tile_set | Method | |
get_tile_size | Method | |
set_tile_size | Method | |
validate_runtime | Method | |
get_owner | Method | |
get_owner_root | Method | |
get_origin | Method | |
get_editor_issues | Method | |
get_runtime_issues | Method |