Documentation‎ > ‎

2. Targetable

Putting this on a GameObject marks it as targetable by a TargetTracker. Without this component, a GameObject will be ignored by the system.  The Targetable component is also a key access point for responding to being hit (manually or automatically) and more.

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 Targetable Code Reference section.

Is Targetable
Turning this off effectivly "hides" this Targetable from TargetPRO, meaning it won't be detected by any TargetTrackers.
Debug Level
Set this to control the amount of information printed to the Unity Console to aid development.

Delegates

This component offers several event delegates which can be subscribed to in order to receive information and run code in your scripts. (See the code reference for more detailed information) :
OnHit(HitEffectList effects, Target target)
Triggered every time this targetable is "hit" (sent information). This event can be triggered directly using Targetable.OnHit(...), a TargetTracker (if triggered through scripting), but usually by a FireController or Projectile. This is the main information delivery event to provide HitEffects that subscribers can use to implement game logic.
Argument:  A list of HitEffect structs which represent all the effects sent by a TargetTracker, FireController or other script.


OnDetected(TargetTracker source)
Triggered once when this target is first detected by a TargetTracker.
Argument: A reference back to the TargetTracker component which triggered this event


OnNotDetected(TargetTracker source)
Triggered once when this target is no longer detected by a TargetTracker.
Argument: A reference back to the TargetTracker component which triggered this event