Senses & Targeting Fields
Physics-based detection volumes for the targeting system — interaction fields and sensory detection.
Categories:
Targeting fields are physics-based detection volumes that feed target registrations into the Targeting Handler. The GS_TargetingInteractionFieldComponent provides proximity detection for interact-range targets. Fields use their own collision layers and should be placed on child entities rather than the main unit capsule.
For usage guides and setup examples, see The Basics: GS_Interaction.
GS_TargetingInteractionFieldComponent
A physics trigger volume that detects targets entering and exiting the interaction range. Extends AZ::Component and PhysicsTriggeringVolume. Registers detected entities with the parent Targeting Handler.
API
| Method | Parameters | Returns | Description |
|---|---|---|---|
TriggerEnter | AZ::EntityId entity | bool | Called when an entity enters the field. Registers the entity as an interaction-range target. |
TriggerExit | AZ::EntityId entity | bool | Called when an entity exits the field. Unregisters the entity from the interaction-range list. |
Setup
- Create a child entity under the unit entity that owns the Targeting Handler.
- Add a PhysX collider configured as a trigger shape.
- Add the GS_TargetingInteractionFieldComponent.
- Set the collider to use a dedicated interaction collision layer — do not share the unit’s physics layer.
- Point the field to the parent Targeting Handler entity.
Extension Guide
Custom sensory fields can be created by extending the base field pattern:
- Create a component that extends
AZ::ComponentandPhysicsTriggeringVolume. - On trigger enter/exit, call
RegisterTarget/UnregisterTargeton the Targeting Handler viaGS_TargetingHandlerRequestBus. - Add custom filtering logic (line of sight, tag filtering, team affiliation) in your trigger callbacks.
See Also
Get GS_Interaction
GS_Interaction — Explore this gem on the product page and add it to your project.