W
Wolfrick
Guest
Whenever the obj_leftBullet_shooter hits the enemy obj_water, the enemy is supposed to die in one hit. It works fine until I code in instance_destroy(); for the obj_leftBullet_shooter and I don't know why. If I code it so the bullet disappears once it hits the enemy, sometimes it'll take multiple hits before the enemy gets destroyed. This only happens once I've coded in the instance_destroy(); for the bullet.
Current Code:
obj_water, [event] collision with obj_leftBullet_shooter
obj_water [event] step event
obj_leftBullet_shooter, [event] collision with obj_water
Current Code:
obj_water, [event] collision with obj_leftBullet_shooter
Code:
///Collision Effect
//Die when hit by bullet
with(obj_water){
obj_water.hp -= 100;
}
instance_destroy();
Code:
//Death
if(hp == 0){
instance_destroy();
}
Code:
///Destroy
instance_destroy();