Help creating game levels | Too much entities crashing online editor

Good day PlayCanvas community,

I’ve just encountered a problem while attempting to create levels for my game. I’m attempting to make each level and entity that’s to be enabled when called. I tried testing how many levels I can create by copying and pasting the first level. I only did this 10 times before the engine started crashing (even while entities are disabled).

I assume this is not the optimal way to create a good amount of levels. Can anyone offer any assistance by recommending another method of creating many levels? Thanks

You can have a ‘core’ that has all the essential entities, code etc, and each level as extra scenes to be loaded additively and removed.

2 Likes

You could do what I did in a game I ddi like 5 months ago and just different scenes like yaustar said it would makes things less complicated,plus you can keep track of what level you want and what levels you dont need

1 Like

thanks for the reply Marquise, do you have any sample code of how to do this? Also if it’s possible i would like to know if you can access entities from one scene and add them to another

Thanks for the reply yaustar, is it possible for me to access an entity in another scene and then add it to the current scene? I think this would make my project a lot simpler

No, you can’t ‘add’/clone entities from other scenes unless that scene is loaded.

2 Likes

What about multiple scenes being loaded at once? The example on the tutorial page destroys one scene and loads the other

The example on the tutorial page destroys one scene and loads the other. What about multiple scenes being loaded at once?

Yes, scenes can be loaded additively.

If you look at the scene load example, you can see where it is destroying the Root node of the old scene after the load. If you don’t do that, then you will have both scenes loaded.

I also recommend renaming the root node in the scenes to something unique to make them easier to find or add an unique tag.

1 Like

Thank you so much yaustar. I think this solved my issue now.

1 Like