This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Targeting Handling

Image showing the TargetingHandler component, as seen in the Entity Inspector.

Targeting Handler Overview

Functionality

Selection Offset

Knowledge Processing

Stat driven values that determine how long a target needs to be detected to beceome part of the “active knowledge” of the unit. Applies to players as well, as the targets will be non-selectable if unknown.

Memory Processing

Targeting Cursor

Interaction Range Field

A unique Sense Field.

Collider that defines the most immediate interactable targets.

Gives “In Interaction Range“ cross reference to the senses targets.


Setting Up Your Targeting Handler


API

// GS_TargetingHandlerIncomingEvents::Handler overrides
bool RegisterTarget(AZ::EntityId entity) override;

bool UnregisterTarget(AZ::EntityId entity) override;

bool RegisterInteractionRangeTarget(AZ::EntityId entity) override;

bool UnregisterInteractionRangeTarget(AZ::EntityId entity) override;

AZ::EntityId GetInteractTarget() override { return interactTarget; };

// Local Methods
virtual void CheckForTick();

virtual void ProcessClosestInteractable();

ProcessAllInteractables

Determines the closest target, then processes the type that target is: Interactable/Item. Then sets the SelectedTarget to that single target.

Get Nearest methods fulfil the Processing, as well as AI checks.

Has Target of type. Query the database.


Extending Targeting Handler