How do I destroy single instance of hidden sprite attached to enemy sprite?

0 favourites
  • 3 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • I have an flying enemy moving back and forth with sine behavior. I have a attached a hidden turret to it (so that the enemy doesn't show rotations while it's floating back and forth). I set the hidden turret sprite to be destroyed when the flying enemy is destroyed. This destroys all hidden turrets (even though only that one instance of flying enemy is destroyed). How do I only destroy the instance of hidden turret that is attached to the image point of that flying enemy?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You just need to pick the hidden sprite, this can be done in a number of ways. You could use hidden sprite is overlapping enemy if they are touching. Or in this case a container may work well, if you put the enemy and hidden sprite into a container, whenever you destroy the enemy it also automatically destroys all other objects in the container so including the hidden sprite.

  • Thanks, that worked exactly how I needed it to! once I added the hidden turret to the flying enemy container I didn't have to add any other conditions. It automatically destroyed both single instances of the enemy and turret when the enemy was destroyed.

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