Skip to content

Class

GridPositioner3D

Generated GDScript class reference for GridPlacement.GridPositioner3D.

Status
Current
Version
v6.1.0
Source updated
2026-09-24
Generated on
2026-09-23

Controls the on-grid cursor used by building/interaction systems in 3D. 6.0.0-3D-Surface (Wave B1.3): production 3D positioner. Drives a [GridPlacementHost] via [_input] / [_physics_process] dispatch, resolves the camera cursor to a GridMap cell via [Camera3D] ray-cast + [GridMap.local_to_map] (through [GridPositioner3DSpike]). It self-configures from its exported session ([set_dependencies], [set_targeting_state]); the host's consumer binder skips positioners. Difference from the 2D positioner: 2D uses [Camera2D] + canvas-transform projection; 3D uses [Camera3D] + ray-cast to a ground plane. The 2D visibility/recenter/diagnostic pipeline is intentionally not mirrored; consumers use the host's mode + visibility logic instead. No extends PlacementNode2D/3D: this is a stand-alone Node3D, matching the 2D positioner, which does not extend the per-node DI base either.

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, or [constant MISS] when the ray leaves the grid (sky/void). Consumers clear hover feedback on MISS; the dedupe guard suppresses repeat emits.
cell_clickedSignalEmitted when a mouse button is pressed while targeting a valid cell. Consumers decide what a click means; the positioner stays placement-agnostic.
LOG_PREFIXField
MISSFieldSentinel returned by [method ray_from_screen_to_cell] on a grid miss; same contract as [GridPositioner3DSpike.SPIKE_MISS].
cameraPropertyActive camera, set via [method configure] or auto-resolved from [code]viewport.get_camera_3d()[/code].
gridPropertyActive target grid, set via [method configure] or resolved from the targeting state.
sessionPropertySession this positioner serves. When set, [method _ready] self-configures and registers with the nearest [GridPlacementHost].
cursor_sourcePropertyInjected cursor-source callable returning a [Vector2] screen position; tests inject a fixed value for deterministic positioning.
ui_policyPropertyPolicy answering pointer-over-UI for press gating. Games whose UI never drives viewport hover, and headless tests (hover needs a display), replace this with a custom [PositionerUIPolicy].
input_processing_enabledPropertyEnables/disables input processing; mirrors the 2D positioner's [code]input_processing_enabled[/code].
get_current_cellMethod
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
ray_from_screen_to_cell_occludedMethod
get_spikeMethod
move_positioner_by_tileMethod
get_runtime_issuesMethod
validate_dependenciesMethod
remove_self_as_positionerMethod