TargetSensor2D
TargetSensor2D
6.0 grid target sensor adapter that implements
- Convert world positions to grid coordinates using a configurable cell size and origin.
- Provide the world position for a given grid coordinate (tile center).
- Register itself in the global
so systems such as can resolve . This intentionally focuses on coordinate conversion; physics and gameplay validation are handled elsewhere (e.g. core targeting services and rules).
Project: GridPlacement v6.0
Layer: Godot
Source: Godot/Targeting/TargetSensor2D.cs
Namespace: GridBuilding.Godot.Targeting
Kind: class
Parsing Method: AST-based (Roslyn) - NOT regex
⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.
Properties
CellSize
Size of a single grid cell in world units.
Origin
World-space origin of the grid (cell 0,0).
Methods
_Ready
Godot lifecycle entry point. Registers the sensor in the global service registry and attempts to auto-wire a child probe if present.
Returns: void
GetTargetAt
Returns: (CoreVector2I GridPosition, bool IsValid)
Parameters:
Vector2 worldPosition
GetWorldPosition
Returns: Vector2
Parameters:
CoreVector2I gridPosition