How do i storing object uid an array?

  • I want storing uids but only these objects which overlapping my sensori sprites.

    Or possible somehow i foreach only these objects which overlapping a another sprite object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think this should work:

    Have Array width set to 0 before beginning.

    On start of layout:

    For each (ordered) X.UID ascending

    X is Overlapping Y - Push X.UID front of Array

    If you're not doing something at the start of the layout you can try:

    - For each X

    -

    - ----- X is Overlapping Y - Push X.UID front of Array

    - ----- Once While True

    ------------------------------------

    - ----- X is not Overlapping Y - Call function ("Check for X.UID"(X.UID)

    - ----- Once While True

    On function "Check for X.UID" (X.UID) -

    Repeat Array.width times

    System compare Array.at(loopindex) = function.param(0) --> Array Delete (loopindex)

    I'm away from home but I hope that works!

  • Hey, go ahead and neglect my first post. The "on start of layout" method works but the other one does not because of the for each loop.

    I've made a capx (you can open those on C3 as well right?) with a working method for you that works dynamically.

    https://www.dropbox.com/s/pk3o9bl4palc7 ... .capx?dl=0

    Hope this is helpful!

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