• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Need help with tower defense

J

jaigantor

Guest
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
 
G

Guitarmike

Guest
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.
 
Top