Initialisation order of game objects

Is there a way to determine or define the order which game objects are initialised?

Right now I’m using ‘print’ statements in each init() function to see the order.

No, you are not guaranteed init or update order. But you can force an order by putting the real init behind a globally imported queue order and then call a secondary init / update once you activate that object.

2 Likes

@benjames171

http://www.defold.com/manuals/sound/7

This article on gating was originally written about sounds, but the concept may be applicable to your case.

I have something similar happening in my game, but I do a trick where I place the sprites offscreen in the editor, and then use a timer based on the location of the object in order to move everything into place. It’s very simple but effective.

1 Like