I am trying to make a Playcanvas project to load the scene of another Playcanvas project

In Unity, there is AssetBundle, LoadSceneMode.Additive. I am trying to do something like this with PlayCanvas.

the idea of my project is, one developer prepare game stages in PlayCanvas Editor, another one prepare interactive content in PlayCanvas Editor, and then i use Playcanvas native engine to load the game stages and interactive content together. I can’t explain it without exposing the project detail, but it has to be this way in the ideal way. So far, i can do game stages loading after my script already hardcodedly created something in the scene. but i see that the api require me to load a config file to load the scene, which indicate mixing two projects may be impossible.

I am stilling trying because deep down PlayCanvas is open source js engine so there should be a way. Any suggestion for me?

So are you trying to load a new scene within the project or from another project? (Just trying to make sure). Also It would help if you took some screenshots of the project, so I can understand what you’re trying to do.

from another project.

so it seem i must load project config.json to load its scene. the loading is additive (which seems good), but the setting will be replaced. still finding a way to perfectly remove the prev scene

Okay, but I have a question. Why don’t you make a new scene in the same project?

Look at this example: https://playcanvas.com/project/437633/overview/changing-scenes.
In this example, created 1 project, which contains 2 scenes. Each scene has a unique id by which you can refer to the scene. Within one project, everything works fine. However, I think that you can try to access the scene from another project on its id to load it instead of the current scene. Personally, I did not check it. :grinning:

It’s been a while since I last looked at the loadup for a PlayCanvas project. The main challenge I can foresee is if the projects have their own scripts, then they would need to be merged/both loaded in the HTML/loadup procedural. You may also need to merge the config files together.

It all sounds doable though.

1 Like