Documentation‎ > ‎

3. Target Tracker

The Target Tracker component is responsible for tracking and sorting all Targets in range. The results of the component is a simple list of Target structs for use by other components, such as the FireController.

This section will familiarize you with the Editor interface and options so you can get started right away. More detail on how this system is implemented is provided in the TargetTracker Code Reference section.

Number of Targets
The number of targets returned by the TargetTracker. For example, if the sorting style is "Nearest" and there are 5 targets in range, and you enter "2" in to this parameter, then the 2 nearest will be returned on each check.

Use -1 to hit all targets in range.

Target Layers
One or more Unity Layers used to reduce the number of objects processed by the perimeter. Only GameObjects in these layers will be found and checked for a Targetable component.

Sorting Style
The sorting method to use when returning the list targets.

Minimum [Sort] Interval
How often the target list will be sorted. If set to 0, sorting will only be triggered when Targets enter or exit range.

Perimeter Layer
The layer the perimeter will be added to when it is created at run-time. The perimeter is created when the GameObject with this TargetTracker is instantiated. You are given this object because the perimeter uses a collider trigger and you may wish to add it to a layer that is ignored by other physics objects in your game. We recommend creating a layer in your game called "Perimeters".
Perimeter Shape
The shape of the area that will be used to detect targets in range.


Gizmo
Turning this check box on will display the Perimeter based on the parameters you enter. These are drawn in the editor only, are not geometry and will not render. This is just to help you setup your perimeters.

Range
The range parameters available will change depending on the shape of the perimeter.
Position Offset
Use this to offset the position of the perimeter from the GameObject with this TargetTracker component. You can use the gizmo option to visualize what the perimeter will look like without running the game.
Rotation Offset
Use this to offset the orientation of the perimeter from the GameObject with this TargetTracker component. You can use the gizmo option to visualize what the perimeter will look like without running the.
Debug Level
Set this to control the amount of information printed to the Unity Console to aid development.