help! how to destroy only one sprite?

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • help guys ): when i use events to destroy an enemy sprite, construct destroyes all the same sprites on the level.

    afcourse there are multiple enemyes, but i want the event to kill only the one that is triggered not everyone ):

  • voala, i have detirmined that the WAIT plugin is the problem.

    i want the object to destroy itself after 3 seconds when it sees the player.

    and it works, but when i add wait 3 seconds it destroyes every enemy of the type

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have not used the "WAIT" plugin, but I think I have a fair idea of what the specific issue is.

    The initial check is a point of reference for which Enemy to destroy. However after 3 seconds, it does not have that point of reference, so it culls the lot. To get around this issue, I would suggest making use of a private variable to calculate the 3 second delay. Something along the lines of

    Enemy.value('isSeen') greater than 0 - clamp(Enemy.value('isSeen') + 100 * timedelta, 0 , 300) - Destroy Enemy.

    And have an event that is like this

    Enemy.value('isSeen') equal to 0 - set Enemy.value('isSeen') - 1

    So this will only trigger once, and it will be unique to each Enemy.

  • thank you, if i encounter the problem again ill be sure to use this, sounds kinda hard right now but ill understand it. i appretiate the help

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