How does the array "For Each XYZ Element" work?

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Hi all,

    First post, so be gentle...

    I can't seem to find how the arrays cycle through each cell when using "For each XYZ Element". I assumed it was X>Y>Z but the results seem to indicate otherwise, X<Y<Z didn't seem to work either.

    I couldn't seem to find this level of detail in the manual (although it answered all my others questions ) and there's a million posts relating to arrays but I couldn't find one discussing this yet.

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It is indeed x>y>z (or z>y>x, depending on your point of view)

    It will start at X=0, Y=0, go through all the Zs. Then Y=1, and all the Zs again.

    So: (xyz order, 3x3x3 array)

    000

    001

    002

    010

    011

    012

    020

    021

    022

    100

    101

    102

    110

    111

    ect...

    If you want to see for yourself, try the following:

    + System: On start of layout

    + Array: For each XYZ element

    -> Text: Append newline&?Array.?CurX&?Array.?CurY&?Array.?CurZ

  • Ah ok, so I'm a dumbass. Well at least we've all learnt something. Thanks oosyrag, good post

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