How do I make instances in a family act independently?

0 favourites
  • 2 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • So I've got a family set up for objects with a certain AI. I only have one object in the family right now. All instances do the same thing at the exact same time, which is incorrect. I thought I could fix it by putting all of the events on the sheet under a "For each" event, but now all of instances only act when the first instance acts. I'm guessing there's a simple solution for this, and I'm just missing it. Can I get some advice?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually it's the last instance in the for loop that sets the actions.

    What you need to do is not globally activate the groups (because then it will be the same for every family member in the end, since the last of the loops just decides what's active and what not). Simple advise: use an instance variable for that family, maybe call it "mode" and assign to it "look" "chase" "attack".

    Then in your chase events first pick family by comparison family.mode = "look", or whatever action you wanna do. This way only family members will be affected, that are in the correct mode.

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