simple hit point to one actor question

benkhun21benkhun21 Member Posts: 19
edited April 2012 in Working with GS (Mac)
if I am spawning the same enemy actor over and over again, how do I tell GS to destroy only the one actor have 0 hit points.
What is happening now is when game.enemyhp = or (less) than 0 , destroy actor and they all get destroy. I only want the one actor to get destroy and not them all. Thanks in advance

Answers

  • lukey5227lukey5227 Member Posts: 111
    You probably have a global variable (GameSalad Language: Scene Attribute). What you need to do is go into the enemy and add and attribute. Do everything you did.

    How it works: When an enemy spawns, it has its own attribute. Its own attribute can't be changed by anything but itself. That way, when a bullet hits another, it changes THAT enemy to 0 HP and not any of the others.

    Hope I could help!
  • benkhun21benkhun21 Member Posts: 19
    yeah, good point. I completely forgot you can have actor based variable. thanks for reminding me.

    I am still not clear on how u would go about it, since I want to keep the number of actors to a min, but have been recycle themselves. Any help would be appreciated
Sign In or Register to comment.