B
bluGecko
Guest
Hi,
Currently my enemies have an aggression system where when they spawn, they're set to a random aggression. With this system I have it set up where some enemies attack the player or another enemy.
My issue is that if I add a "place_meeting" event with the bullet(weapon) that the enemy shoots with the enemy object, as they shoot they receive damage as well.
Essentially what I need is for the enemy to be able to shoot the same bullet that it takes damage from, but without receiving the damage when the enemy shoots it, so that the enemy being shot at is the one receiving damage
Thank you in advanced.
Current Code in the "obj_npc" step event:
Another issue with this code, is that the bullet(weapon) is destroyed as its shot.
Currently my enemies have an aggression system where when they spawn, they're set to a random aggression. With this system I have it set up where some enemies attack the player or another enemy.
My issue is that if I add a "place_meeting" event with the bullet(weapon) that the enemy shoots with the enemy object, as they shoot they receive damage as well.
Essentially what I need is for the enemy to be able to shoot the same bullet that it takes damage from, but without receiving the damage when the enemy shoots it, so that the enemy being shot at is the one receiving damage
Thank you in advanced.
Current Code in the "obj_npc" step event:
Code:
if place_meeting(x, y, obj_weapon_npc){
hp -= 5;
with(obj_weapon_npc){
instance_destroy();
}
}