How do I correctly control multiple instances of the same Object?

0 favourites
  • 3 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • Hi there, apologies in advance as this is a bit of an open question and something I've been unable to wrap my brain around.

    I have an object that has an instance variable called Action

    When Action is 0, it does X

    When Action is 1, it does Y

    When Action is 2, it does Z

    The problem arises when there are multiple instances of this object.

    If there are two instances where Action=1, it seems that only one of them will do Y the other will do nothing.

    How do I correctly sequence these, so that both of them do Y rather than just one? Is it for each or something else ... please answer like I'm 5 years old haha

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You've got the answer right there - use for each object.

  • You shouldn't need to use a loop, as all instances that meet the conditions should have the logic applied to them. There must be something else in your code making that happen.

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