• Opsive has been nominated for TWO Unity Awards: Publisher of the Year and Best Development Tool (Behavior Designer Pro)! Your support means everything, cast your vote here: https://awards.unity.com/vote

How to detect if killed by explosion within onDeath?

finaratic

Member
What title says, how can i detect if killed by explosion within onDeath event? I need to know when killed by grenade. Seems like there is now way except for changing the event params to include some bool isExplosion or something, but seems much work since a lot of changes in a lot of scripts
 
There isn't a way with the OnDeath event, but you could subclass the CharacterHealth component and add a new event that sends the DamageData when the health reaches 0. The DamageData contains the source of the damage (which in your case would be the explosion)
 
Back
Top