Chris' Tutorials
Docs/Grid Placement

Class

GridPositioner3D

Generated GDScript class reference for GridPlacement.GridPositioner3D.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

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

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.

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_changedEventEmitted when mouse targeting resolves a different GridMap cell.
cell_clickedEventEmitted 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
clickProperty
clicked_cellProperty
set_input_processing_enabledMethod
is_input_readyMethod
are_dependencies_readyMethod
set_dependenciesMethod
set_targeting_stateMethod
move_to_viewport_center_tileMethod
viewportProperty
screen_centerProperty
move_to_cursor_center_tileMethod
screen_posProperty
ray_from_screen_to_cell_or_nullMethod
cellProperty
ray_from_screen_to_cellMethod
get_spikeMethod
move_positioner_by_tileMethod
grid_refProperty
get_runtime_issuesMethod
issuesProperty
validate_dependenciesMethod
issuesProperty
remove_self_as_positionerMethod
viewportProperty
viewportProperty
resultProperty
world_hitProperty
cellProperty
grid_refProperty

Source

addons/grid_placement/systems/grid_targeting/grid_positioner_3d.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs