Skip to content

Class

GridPositioner3D

Generated GDScript class reference for GridPlacement.GridPositioner3D.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

Controls the on-grid cursor used by building/interaction systems in 3D. 6.0.0-3D-Surface (Wave B1.3): production 3D positioner, the public-facing 3D surface for placement targeting. The 3D positioner:

  • Drives a [GridPlacementHost] via [_input] / [_physics_process] dispatch (parallel to the 2D positioner's contract)
  • Resolves camera cursor → GridMap cell via [Camera3D] ray-cast + [GridMap.local_to_map] (via [GridPositioner3DSpike])
  • Mirrors the 2D positioner's DI lifecycle ([resolve_placement_dependencies], [set_dependencies], [set_targeting_state]) Difference from the 2D positioner: the 2D positioner uses a [Camera2D] + canvas-transform projection; the 3D positioner uses a [Camera3D] + ray-cast to a ground plane (the spike's math). The 2D positioner also carries a full visibility reconciliation + recenter policy + diagnostic pipeline (965 lines) which is intentionally NOT mirrored in Wave B1; consumers of the 3D surface use the host's mode + visibility logic instead, parallel to how the 2D services were refactored in 6.0.0-S. No extends PlacementNode2D/3D: the 2D positioner does not extend the per-node DI base class either, and the 6.0.0-S refactor moved dependencies to the host + session model. Mirroring that means the 3D positioner is a stand-alone Node3D, not a custom base.

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

Syntax

class GridPositioner3D extends Node3D

Members

NameKindSummary
cell_changedSignalEmitted when mouse targeting resolves a different GridMap cell.
cell_clickedSignalEmitted when a mouse button is pressed while targeting a valid cell. Consumers (e.g. [ObjectPlacementService3D] wiring) decide what a click means; the positioner stays placement-agnostic.
LOG_PREFIXField
MISSFieldThe sentinel returned by [method ray_from_screen_to_cell] when the ray misses the grid. Same contract as [GridPositioner3DSpike.SPIKE_MISS].
cameraPropertyThe active camera. Either set via [method configure] (preferred) or auto-resolved from the viewport if the positioner is the current camera's parent. The 2D positioner auto-resolves from [code]viewport.get_camera_2d()[/code]; the 3D version auto-resolves from [code]viewport.get_camera_3d()[/code] as a fallback.
gridPropertyThe active target grid. Either set via [method configure] or resolved from the targeting state.
cursor_sourcePropertyInjected cursor-source callable. Returns a [Vector2] screen position (parallel to the 2D positioner's [code]cursor_source[/code]). Tests inject a fixed Vector2 for deterministic positioning.
input_processing_enabledPropertyPublic flag & API for enabling/disabling input processing. Mirrors the 2D positioner's [code]input_processing_enabled[/code].
resolve_placement_dependenciesMethod
set_input_processing_enabledMethod
is_input_readyMethod
are_dependencies_readyMethod
set_dependenciesMethod
set_targeting_stateMethod
move_to_viewport_center_tileMethod
move_to_cursor_center_tileMethod
ray_from_screen_to_cell_or_nullMethod
ray_from_screen_to_cellMethod
get_spikeMethod
move_positioner_by_tileMethod
get_runtime_issuesMethod
validate_dependenciesMethod
remove_self_as_positionerMethod