Targets
Categories:
Target components mark entities as detectable by the targeting system. The base GS_TargetComponent provides core target data (size, offset, visual properties). Specialized variants like GS_InteractTargetComponent add interaction-specific behavior.
For usage guides and setup examples, see The Basics: GS_Interaction.
GS_TargetComponent
Base target component. Makes an entity visible to the targeting system with configurable visual properties for cursor feedback.
GS_TargetRequestBus
Bus policy: ById, Multiple
| Method | Parameters | Returns | Description |
|---|---|---|---|
GetTargetSize | — | float | Returns the target’s visual size for cursor scaling. |
GetTargetOffset | — | AZ::Vector3 | Returns the world-space offset for cursor positioning above the target. |
GetTargetColour | — | AZ::Color | Returns the target’s highlight colour. |
GetTargetSprite | — | sprite ref | Returns the target’s cursor sprite override, if any. |
GS_InteractTargetComponent
Extends GS_TargetComponent with interact-specific properties. Entities with this component can be selected as interact targets by the Targeting Handler and triggered via the Interact Input system.
Cross-Gem Target Types
Additional target types are conditionally compiled when GS_Interaction is available alongside other gems:
| Type | Source Gem | Condition | Description |
|---|---|---|---|
| ItemTarget | GS_Item | #IF GS_INTERACTION | Makes item entities targetable for pickup and inspection. |
| UnitTarget | GS_Unit | #IF GS_INTERACTION | Makes unit entities targetable for interaction and AI awareness. |
Extension Guide
Create custom target types by extending GS_TargetComponent:
- Create a new component class extending
GS_TargetComponent. - Override the target data methods (
GetTargetSize,GetTargetOffset, etc.) to return your custom values. - Add any additional data fields specific to your target type.
- The targeting system will automatically detect and categorize your custom targets when they enter sensory fields.
See Also
Get GS_Interaction
GS_Interaction — Explore this gem on the product page and add it to your project.