Explosive

This component makes your prefab “spark interest in anybody nearby”. And that means your prefab can blow up and destroy everything around!

Component Explosive Fields

TypeNameDescription
numberexplosiverangethe range of effect when detonating
numberexplosivedamageThe damage dealth to living things
numberbuildingdamagehow much "work" is being done to the buildings in range
booleanlightonexplodeWhether to light nearby things on fire (requires burnable)
functiononexplodefnFires on detionation. Args: inst
functiononignitefnFires when the explosion is initiated, but hasn't occured yet. Args: inst

Component Explosive Methods

NameParameterReturnsDescription
SetOnExplodeFnfnnilalternative way to set that function
SetOnIgniteFnfnnilalternative way to set that function
OnIgnitenilnilartificially ignite the prefab (you can do that from burnable too)
OnBurntnilnilartificially detonate the prefab; good for when your prefab is uninflammable

Component Explosive Events

NameDataFires in/when...
explosion (on prefabs hit)explosive (that's this instance)After applying damage and so on.
explosion (on world)damageAfter affecting surrounding prefabs
deathnilAfter all the explosion stuff, if the exploding prefab has health.

Example