AutoTarget
Overview
The AutoTargetSystem
is used to track focus on a specific target (Entity). This is an essential component for more advanced behavior such as autofire.
AutoTarget features set includes:
- the
AutoTargetSystem
; - the
IAutoTargetController
; and, - the
AutoTarget
component.
The AutoTargetSystem
handles the updating of the AutoTarget
components while the IAutoTargetController
is implemented by controller to provide physics query and resolve hits or provide a custom solution to entity selection.
Component
The AutoTargetSystem
manipulates and updates all AutoTarget
components to achieve:
- Human-like behavior via reaction latency; used mainly by AI agents to make them feel more like analogue players.
- Full control over target query - the default is a physics raycast query based on the agent's
Transform3D
.
Properties
The AutoTarget
component's behaviour can be modified by tweaking the following properties:
Max Range
: visibility distance for physics raycastReaction Time
: time needed to set a raycast hit entity as the target or clear the target if the hit entity is lostThink Reaction Time
: time needed to set a raycast hit entity as the target if there already is a last known target (i.e. switch between targets)Target Lost Time
: time needed to forget the last known target