For each object Help

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • The highlighted condition is only running once according to the test Global var, when I can see in the debugger that there are 4 arrays created, even if none of the actions worked, the Test global var should be 4. Thoughts? thanks for help :)

  • everything above the highlighted condition is working as expected

  • Instances you create in event 2 are not available immediately in event 5. You can fix it with "Wait 0":

    Note that Wait 0 delays execution until the end of the tick, which may break some logic in other events.

    Another (and probably better) option is to move events 6-8 into a function or a custom action. Call that function/custom action from events 3 and 4, for each created array.

    Also, you mentioned that the code runs once, which indicates the array is global and already has one default instance. If you then create four more array instances, you’ll end up with five in total. Either destroy the initial instance at the start, or set the array to not be global.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you, great info, I'll move it to a function.

    Yeah, the array is Global, the original is destroy on start, but was still returning 1. Odd

    Thanks again, you rock.

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