Documentation‎ > ‎

6. Detonator

A detonator is like a HitEffect delivery system that expands over time to the final range, rather than instantly notifying all Targets in range. This is excellent when simulating large explosions or traveling effects like a wave. Each Target is only notified once OnHit.

This can be instantiated directly or drag&dropped on to a Projectile to be triggered using the Projectile's range and EffectsOnTargets list.

Detonators inherit from TargetTracker and also implement some FireController features, so much of this will look familiar...
Hit Layers
One or more Unity Layers used to reduce the number of objects processed. Only GameObjects in these layers will be found and checked for a Targetable component.

Range Layer
The layer the range (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".
Detonation Shape
The shape of the area that will be used to detect Targets.

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.

Expand Duration
This is how long, in seconds, it will take for the detonator to grow to the Max Range size.

Max Range 
This is the final size the detonator will grow to. The available parameters will change depending on the detonation shape.
Effect On Targets
Define the effect this fire controller will have on hit targets (ignored if "User Projectile Effects" is ON). You can define more than one, which is handy if you have a magic effect that will cause damage and slow down a target. This information is sent to targets when hit, or accessed via the API by other components. 

The target should implement the logic to determine how to respond to the effects you define here. The reason for this is that each target may have abilities that modify the effect. For example, an enemy may have a resistance to a slow effect, or a friend may have a "buff" which increases a healing effect. 

Here is a guide to using the GUI list features...
Debug Level
Set this to control the amount of information printed to the Unity Console to aid development.


This component offers several event delegates (See the code reference for more detailed information) :
OnDetonation(TargetList targets)
Runs when this detonator is first triggered.
OnDetonatingUpdate(float progress)
Runs every frame.