Hi guys,
i want to make some explosions have radius based damage that can damage multiple enemies, but my current bullet/enemy/damage setup is giving me a hard time.
At the moment, all the damage dealing stuff is set up like this:
- Bullet hits the enemy
- Bullet takes the current HP from enemy, deducts the damage it is making, and feeds back the new HP to enemy
- Enemy checks if HP is 0, if it is, it dies, if it is not, goes back to idle state
It can be simpler, but i have many modifications that makes it necessary to work this way.
Splash damage is easy to implement from the enemy side, as every enemy can detect the collision with the explosion collider and apply damage to itself, but since the logic of dealing damage in my case is on the bullet/explosion side, only the first enemy that collides with the explosion will be hit, and rest will remain undamaged.
Any ideas on this one? Some spherecast with adding enemies in the blast radius to an array and the cycling through all of them?