Object variable condition on objects within family

  • Hi all

    Just licenced my C2 so I figured it is the right time to also join the "friendly community" (as Scirra put it <img src="smileys/smiley1.gif" border="0" align="middle" /> )

    I looked through quite a few posts but couldn't find an answer for my prob: What I am trying to do is to run one "family condition" on multiple objects (all from the same family)so each of them is destroyed or not according to its own variable value.Is it possible to make such action with a single condition line? I only managed to make a condition with the family variable, but not with object variable.

    Thnx

    M

  • Anyone?

  • Could you be more specific and provide a sample .capx or at least a screenshot of the logic?

  • Hi xoros <img src="smileys/smiley1.gif" border="0" align="middle" />

    I have a text family named ShowResults including the objects ShowResult1, ShowResult2,...ShowResult(n).

    Each object has the variable Result.

    The multiple condition I want to run on the entire family is:

    IF ShowResult(x).Result=0 destroy ShowResult(x).

    Family variable will not help here since it is common to all family objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The family variable is common to all family objects but not it's value. Each member can have it's own separate value.

  • Thanx ramones :)

    I was not aware of that.

    Will "IF ShowResults.Result =0 Destroy ShowResults" work for me or will it destroy all family member?

    (Im not near my PC so cant test it till tonight...)

  • It will destroy the family members that have Result = 0.

  • Great. Im all set than. Thnx much!

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