Collection proxy init

Hi,

I’m trying to solve this issue with collection proxy: I have a main menu and a game proxy that get loaded/unloaded from a handler script. Standard Defold pattern as per manual.
Now in my main menu collection I have a logo collection with go correctly placed.
In the init of the logo collection I move the element outside the screen and then animate them in with go.animate.

So far so good. Now the issue is that when I move back and forth between the main menu and the game proxies, I can see a flash of the main menu with the elements arranged as per editor before the init function takes over and does its bit of behaviour.

I’ve tried in my controller script first an “init” message and then a one frame late “enable” with no luck as per manual:
This message tells the collection proxy component that all the game objects and components that has been instantiated should be initialized. All script init() functions are called at this stage.

Am I missing something obvious?

Thanks

If you move the game object in the init function of a script it should get the new position on the first frame that it is rendered and you shouldn’t get a flicker.

If you can’t make it work I think it’s best if you share a minimal repro case for us to take a look at.

Thanks.

I’ll make a quick repro project later.
For the time being I’ve solved it by moving the objects off-screen

Here’s an example project.

Clicking/touching will cycle you through the 2 different proxies.
When going back to the sliding title you’ll see the quick 1 frame flash.

Also tried this on an iPhone6 with the app via the editor, and loading the collections take 4-6 secs!!! Not sure why. Bundling for release moving between the proxies is instant. Will have to investigate that too. Could it be because is in debug mode and via wi-fi?

flash_test.zip (162.3 KB)

Hi! Another quick and easy way to avoid this is by setting the z-layer to something lower than -1. The render script won’t render it until it’s within the range of 1 to -1.

1 Like

Oh haven’t thought about that! Thanks