Pick UID from enemies generically on an OR event

0 favourites
  • 7 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • I want to make an event where when the main character collides with an enemy it destroys it so I am trying the following:

    Event if enemy A collides with hero

    OR

    Event if enemy B collides with hero

    OR

    Event if enemy C collides with hero

    THEN store that enemy UID

    Sub event if hero animation is "attack"

    THEN pick and destroy that enemy using the stored UID.

    Thing is I can't find any way to pick that enemy's UID generically (regardless of the type of enemy A, B or C) I know that this can be achieved by making separate events for each enemy, but I find that to be too redundant.

    Any help will be greatly appreciated :D

    Thanks in advance

  • on collision > set a variable to enemy.uid

    attack animation is finished > pick enemy by uid "variable" > destroy

  • Ok that was what I was pondering right now it seems there is no generic "pick" event that chooses the uid of whatever object collided with hero guess I will have to handle them separately. Thx

  • if you put the enemies into a family you could save the uid of the family

    the collision would pick the right enemy a,b or c

  • if you put the enemies into a family you could save the uid of the family

    the collision would pick the right enemy a,b or c

    How would I put the enemies into a family? What's a "family" in C2 terms?

  • > if you put the enemies into a family you could save the uid of the family

    > the collision would pick the right enemy a,b or c

    How would I put the enemies into a family? What's a "family" in C2 terms?

    Here is link to description of families.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Rhindon & AlucardPR:

    Please note that families are only available in licensed copies of C2.

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