How do I destroy only 1 instance

0 favourites
  • 3 posts
From the Asset Store
Destroy planes and be the best pilot of your time!
  • I have a game in progress when the player fires a "Bullet" out of a gun and shoots the enemy.

    Now I have multiple instances of the enemy moving around the screen and if the bullet hits the enemy the enemy is destroyed. The problem I'm having is that if say 2 or more enemy sprites are overlapping and the bullet touches 2 enemies then both enemies are destroyed.

    How can I make the bullet only kill 1 of the enemies, 1 bullet 1 kill.

    I obviously destroy the bullet when it hits the enemy but still if more than 1 enemy is hit by the same bullet they all get destroyed and I don't want that.

  • You could add a "for each enemy" as your last condition and add a "stop loop" action. Only one enemy would then be destroyed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Inside de collision condition, use "Pick nth instance" (is a zero based list, so zero is the first picked object) to pick only one, then apply your "Destroy" action.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)