How Do I Sort Newly Spawned Objects?

0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I'm trying to build a system that creates an isometric grid from a 2D grid. That seems to be working correctly, however the Z values are incorrect and need to be sorted from bottom left to top right. I figured a For Each ordered by X axis with a move to top of layer action would suffice but nothing happened.

    So I decided to test the For each loop to see if it was finding the newly spawned blocks. This was supposed to count the number of blocks it found and print it so I can see it found everything. But the for each either isn't running or doesn't find anything.

    Does anyone have any idea on why this isn't working? I'll put screenshots of the code and layout, and a copy of the project below.

    Project File

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The function runs in one tick, in Construct when you create objects they are not available to be picked by events until the next tick. You can use waits, there is something called wait for previous actions to complete. If I was doing it I would add a wait after where the action to call the function is so there is no wait inside the function then run the for each loop for the counter.

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