How do I Family.count?

0 favourites
  • 4 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Here is the thing guys.

    I create an instance of object O which belongs to F family.

    If I check O.count match to 1.

    If I check F.count match to 0.

    Is this feature not implemented yet or that way?, or maybe I am doing something wrong?.

    My desired result was F.count match to 1.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just checked families example (https://editor.construct.net/#open=families) and it works pretty good matching to 15 instances when i check Enemies.Count. Only difference I can see is I am creating the object by System's Create Object, while in example they are created from layout design.

  • When you create an instance in runtime, it's not created immediately. It may not be available in other events, and the counters may not be updated until the end of the tick. The easiest workaround is to add "Wait 0"

    Create Object
    Wait 0
    Set n to Family.count
    
  • When you create an instance in runtime, it's not created immediately. It may not be available in other events, and the counters may not be updated until the end of the tick. The easiest workaround is to add "Wait 0"

    > Create Object
    Wait 0
    Set n to Family.count
    

    Pretty right what u say.

    I just made the check in other place (not right after creating the object), and it worked.

    Thank you so much. :)

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