How do I pick UID using families

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • I've created different families to different group of enemies. Now I'm trying to make all those simple colision events like this:

    But using families instead of identifying them directly. Basically, I'm trying to make a general event that, using families, identify the enemy of that family that colided with the character. Doing this way I don't need to repeat this condition for ALL enemies in the game. However, every enemy has it's instance variable that represent their damage. So, the difficult part, which is giving me headaches, is to pick the damage(variable) of an specific enemy that have colided with the character.

    Ex:

    I've tried creating an Instance family variable to take the value(damage) temporarily and then subtract it from player's life. After that I'd set the variable Damage to 0 again.

    Someone knows how to do it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should have the instance value on the family, then the problem goes away. The same rule applies as the collision detection: put the variable on the family, so you don't have to duplicate it everywhere.

  • You should have the instance value on the family, then the problem goes away. The same rule applies as the collision detection: put the variable on the family, so you don't have to duplicate it everywhere.

    I've already have an instance variable for the family and I can't do like this because every enemy has it's damage. They have different damage, I just can't put everything together in a family variable . Understand?

  • The value will apply to each object, not the family as a whole!

  • You are right!

    I got it and it worked. Thank you!

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