Loading Scenes With Addressables

Hello,

I read that Fusion fully supports the addressables system, but when starting to implement it, I realized it supports only spawning prefabs using addressables.

There is no way to load scene using addressable, and it is a crucial part of using addressables, the scene must be loaded using Addressables.LoadSceneAsync, otherwise, a lot of issues coming up.

I tried to code a custom scene manager by extending the NetworkSceneManagerBase but it eventually seems impossible since it is sends SceneRef as a parameter, which should take a int (build index).

When trying to dive deeper into it and modify the code, I see it is impossible since the NetworkRunner is also holding a SceneRef field and it is not editable.

I can't work with Fusion for that reason.

Is there any feasible solution here..?


Thanks in advance,

Omer

Answers

  • Hello,

    If you want to load a scene using addressable, you should store your own valid scenes as AssetReference in a collection of some sort.

    Then, on your custom scene manager you can receive a scene index and use it on the collection to have access to the scene and load it from AssetReference.LoadSceneAsync().

    You can take a look at the advanced asteroid sample. It showcases a simple scene loading using Addressables.

    Also, keep in mind that you don't actually need to use the Runner SceneRef field.

    You can create a custom NetworkSceneManager that reads the active scenes from anywhere.

    An example of that can be seen in Fusion Scene Loading sample.

    -----

    Isaac Augusto

    Photon Fusion Team