0 Favourites

How do I make instances in a family act independently?

  • 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?

  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,489
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,818
minhcuong's avatar
minhcuong
Unread hot topic
99 10,136
karshinkoff's avatar
karshinkoff