Need help with tower defense


Am trying to make it so that when an enemy collides with my object obj_EnemyDeath it is destroyed and I lose a life.
currently on my enemy object I have created a collision instance and this is the code within

with(other) instance_destroy(self);
global.baah --;

*baah being health just a wip name*

it works for the first enemy that collides with obj_EnemyDeath but not for the rest of them,
any help appreciated, thanks


If you created the collision on the enemy object then "other" is pointing at your obj_Enemy_Death and it gets destroyed before any other instances can collide with it. Either get rid of the with(other) or move your collision event to the obj_EnemyDeath.