S
Sursion
Guest
Hello,
I am creating a top down shooter, and I have objects acting as collision meshes along walls. These prevent actors and projectiles from going through them, however, other things that aren't objects still go through them. For example, my splash damage system, or enemies activating rooms away from the player.
Currently the way the splash damage works: In the destroy event, the object checks for all instances of obj_enemy, then calls for hp -= other.damage from all instances within a set range, say 250.
This works great, except when you put the grenade or explosive next to a collision mesh, it still subtracts HP from enemies on the other side of it. Now, I figure a way around this is to make the explosive fire out actual objects as shrapnel, so that they can be destroyed when they hit the collision mesh. But this seems messy and CPU heavy. I figure there has to be an easier way?
Same goes for enemy activation, they activate when the player is in range, but this works through walls also, making most enemies activate at the beginning of a map rather than room by room. What is a way around this? I am fairly new to programming.
I am creating a top down shooter, and I have objects acting as collision meshes along walls. These prevent actors and projectiles from going through them, however, other things that aren't objects still go through them. For example, my splash damage system, or enemies activating rooms away from the player.
Currently the way the splash damage works: In the destroy event, the object checks for all instances of obj_enemy, then calls for hp -= other.damage from all instances within a set range, say 250.
This works great, except when you put the grenade or explosive next to a collision mesh, it still subtracts HP from enemies on the other side of it. Now, I figure a way around this is to make the explosive fire out actual objects as shrapnel, so that they can be destroyed when they hit the collision mesh. But this seems messy and CPU heavy. I figure there has to be an easier way?
Same goes for enemy activation, they activate when the player is in range, but this works through walls also, making most enemies activate at the beginning of a map rather than room by room. What is a way around this? I am fairly new to programming.