Skip to content

TargetingArea2D

Encapsulates Area2D-based targeting logic as a reusable component Unlike ShapeCast2D which only detects PhysicsBody2D nodes, Area2D can detect other Area2D nodes

debug_log_overlaps: bool = false

GB dependencies (typed)

Local debug flag: can be toggled per-instance in editor or by code

func_ready( ) ->

void

Current target being tracked
func resolve_gb_dependencies

(

p_container: GBCompositionContainer

)

->

void

Resolve Grid Building dependencies (logger, targeting state)
func _physics_process

(

_delta:

float

)

->

void

Physics process: continuously update targeting state based on Area2D overlaps

func update_target( ) ->

void

Update the GridTargetingState.target based on current overlaps

func _on_area_entered

(

area:

Area2D

)

->

void

Called when an area enters overlap
func _on_area_exited

(

area:

Area2D

)

->

void

Called when an area exits overlap

addons/grid_building/systems/grid_targeting/grid_positioner/targeting_area_2d.gd


This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.