Next: Health, Previous: Damage Box, Up: Combat [Contents][Index]
BOOM! This component implements damage and physics effects from explosions. You will also need to add a particle effect to your explosion object, and we recommend adding some lights, animation, sound etc as well. This object can destroy itself immeditately after dealing damage & adding force, or you can destroy it a few moments later using other means (if it has visuals attached, this is recommended).
LayerMask rayMaskWhat layers should be checked against a ray at explosion time? Add the layers of the targets as well as occluders.
float radiusHow large is the explosion influence (also affects damage!)
Default value: 10.0f
float powerHow much force?
Default value: 25.0f
float upwardModifierHow much force upwards?
Default value: 6.0f
float damageHow much damage should this deal? Works by sending ’ModifyHealth’.
Default value: 175.0f
bool autodestructShould the explosion object destroy itself automatically?
Default value: false
RotationModes rotationModeShould we randomly re-orient the object on Start?
Default value: RotationModes.None
AnimationCurve rolloffHow should the force of the explosion be affected by distance? Values on the left side are closer to the origin of the explosion, values on the right are closer to the edge. Damage is calculated with the formula (damage * rolloff.Evaluate (_distance / radius)). ’Evaluate’ is a built-in Unity function that determines the final value based on ’rolloff’ curve defined here. If no curve is defined, the rolloff wil be defined linearly.
bool debugWARNING! SLOW OPERATION! Send errors to the console and draw lines
Default value: false
LayerMask rayMaskWhat layers should be checked against a ray at explosion time? Add the layers of the targets as well as occluders.
float radiusHow large is the explosion influence (also affects damage!)
Default value: 10.0f
float powerHow much force?
Default value: 25.0f
float upwardModifierHow much force upwards?
Default value: 6.0f
float damageHow much damage should this deal? Works by sending ’ModifyHealth’.
Default value: 175.0f
bool autodestructShould the explosion object destroy itself automatically?
Default value: false
RotationModes rotationModeShould we randomly re-orient the object on Start?
Default value: RotationModes.None
AnimationCurve rolloffHow should the force of the explosion be affected by distance? Values on the left side are closer to the origin of the explosion, values on the right are closer to the edge. Damage is calculated with the formula (damage * rolloff.Evaluate (_distance / radius)). ’Evaluate’ is a built-in Unity function that determines the final value based on ’rolloff’ curve defined here. If no curve is defined, the rolloff wil be defined linearly.
bool debugWARNING! SLOW OPERATION! Send errors to the console and draw lines
Default value: false
Next: Health, Previous: Damage Box, Up: Combat [Contents][Index]