Targets

Target component types — base target markers and specialized interact targets that make entities detectable by the targeting system.

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

MethodParametersReturnsDescription
GetTargetSizefloatReturns the target’s visual size for cursor scaling.
GetTargetOffsetAZ::Vector3Returns the world-space offset for cursor positioning above the target.
GetTargetColourAZ::ColorReturns the target’s highlight colour.
GetTargetSpritesprite refReturns 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:

TypeSource GemConditionDescription
ItemTargetGS_Item#IF GS_INTERACTIONMakes item entities targetable for pickup and inspection.
UnitTargetGS_Unit#IF GS_INTERACTIONMakes unit entities targetable for interaction and AI awareness.

Extension Guide

Create custom target types by extending GS_TargetComponent:

  1. Create a new component class extending GS_TargetComponent.
  2. Override the target data methods (GetTargetSize, GetTargetOffset, etc.) to return your custom values.
  3. Add any additional data fields specific to your target type.
  4. 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.