Madboy James
Member
Hi,
I have an enemy wave manager, which spawns waves of enemies.
This wave manager needs to keep track of the enemies spawned and those who are still alive.
I tried using the OnDeath event to capture the objects death and stop tracking them... However, it appears than onDeath does not provide the gameobject which did the dying.
If I cannot use OnDeath, what would be the next best way to accomplish this?
I could use OnHealthDamage... but it seems silly to check if the object is dead or not after every damage when there is an event that already fires when it dies.
I may just be using OnDeath incorrectly.
While I am on the topic of events, I have a second question:
Is there an Opsive way/ pattern to have global events, like "player spawned", "game ended", and the like?
I have an enemy wave manager, which spawns waves of enemies.
This wave manager needs to keep track of the enemies spawned and those who are still alive.
I tried using the OnDeath event to capture the objects death and stop tracking them... However, it appears than onDeath does not provide the gameobject which did the dying.
If I cannot use OnDeath, what would be the next best way to accomplish this?
I could use OnHealthDamage... but it seems silly to check if the object is dead or not after every damage when there is an event that already fires when it dies.
I may just be using OnDeath incorrectly.
While I am on the topic of events, I have a second question:
Is there an Opsive way/ pattern to have global events, like "player spawned", "game ended", and the like?