|
Post by jportland on Jan 21, 2017 22:46:42 GMT
Hi,
I need my bombs to deal splash damage to things around the impact point, not to just the Killable it directly hit. I also want the damage dealt to be diminished depending on how far the other units were from the explosion.
Any suggestions on how to do it before i just do it in whatever way i see fit?.
|
|
|
Post by DarkTonic Dev on Jan 22, 2017 1:21:14 GMT
Use the "Deal Damage Prefab" on Killable for splash damage, but you will need to probably spawn a container prefab that has a Triggered Spawner that spawns other things around it when it becomes enabled. As far as custom logic you will need do create a subclass of Killable and use that instead of Killable, then override the TakeDamage method and add your logic. Make sure to call base.TakeDamage with the modified damage points after your logic.
|
|
Oshigawa
Full Member
Posts: 228
Posts: 228
|
Post by Oshigawa on Jan 28, 2017 15:09:54 GMT
Here's a noob approach. You can spawn a death prefab which will measure the distance from the objects you want to deal damage to and use that distance to calculate damage. Or the other way around, measure distance from object taking damage to death prefab and calculate damage according to that (0 distance: full damage, x distance: damage - x). You can use a collider on death prefab so the objects not caught in a blast don't calculate and take damage.
|
|
|
Post by DarkTonic Dev on Jan 28, 2017 18:19:21 GMT
Worth a shot, thanks for the reply.
|
|