compare instance variable of system created objec

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi Guys,

    I have one object OBJECT1 with 4 frames. This object has one instance variable 'VarNumber' - Number

    I'm creating for instances of this object on Start of layout with random SetAnimationFrame.

    After all objects are created I would like to compare either animation frame value or 'VarNumber' value ? Basically see if any instance match to another.

    How to do that ?

    It seems that after all objects are created I can't just use OBJECT1.AnimationFrame variable as it will always be set to last created object frame. Also not sure if I can set instance variable on system create object so new instance could have own value.

    Note that I cant also use trick with passing OBJECT1.AnimationFrame to global variable or to array because what if I would want to have 50 objects ? or might want to perform comparison of farms / instance variables when objects are overlapping ??

    Thanks

    E

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can use the "system --> for each" event to iterate through your created instances to find matches.

  • Thanks I'll try that.

    But how about on collision or on overlap ? Can I compare them somehow ?

    regards

    E

  • You can use Families to check for collisions etc against the same object. You'll find plenty of examples of this in the forum.

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