Collection Proxy to load next level

I have read the documentation about collection proxies and I have been testing them with a main collection and level1 and level2 collections.

After a lot of trial and error, I managed to get it working. I have main collection with the the gui object and a game object with 2 collection proxies (one for level1 and the other for level2) and one script loader. Very similar to the one in the manual.

My problem now is that, when I enter level 2, how am I supposed to load a level 3 once the player reaches the exit? I want to have, if possible, a reusable component to load level after level. If that´s not possible, I would like to know how to do it using collections and collection proxies.

Personally, I found the manual a bit confusing. You explain more or less the basics correctly, but then you use a very weird example in there, instead of using a normal example like the one I am trying to solve, you split the level into 2 collections you want to see at the same time, which is not what normally one needs.

Anyway, I´d really appreciate any help from someone to knows how to do it.

1 Like

Look at the example here

What you want to do is parent your collections and collection proxies. Then you load / unload via the parent container.

What is your level data? A collection or something made with apps such as Tiled?

Thank you for your quick response!

So, let me see if I understand: if, for example, I have 5 levels, I’d need a collection with an object containing 5 collection proxies (1 for each level) and a script that unload/load the correct levels?

My level data is a collection ¨)

Yes, you need a collection proxy pre-made for each (AFAIK). And then you tell each one at a time to load / unload. You can make a “loading” collection visible while you wait for each to be ready.

I think you can have 8 collection proxies loaded / active at a time by default within a single collection, but if you have others in a collection not loaded it may be OK. The documentation on this is not absolutely clear and I’ve yet to fully test. Going to test this…

Just tested - can only have 8 collection proxies per collection max (based on default buffer value) doesn’t matter if they are loaded or not. So maybe you need segment levels by groups of 8. I’m honestly not sure of the best practice of this.

I don’t know what the consequences of increasing the buffer would truly be too. Possibly you could increase it in the project settings and it would be OK to have as many collection proxies in a scene as you need for levels.

2 Likes

Thanks for the response. I will try and let you know if I succeed.

Yeah, maybe the manual should start with a si pler example