Host keeps getting [Scene '' couldn't be loaded because it has not been added to the build settings]

Whenever a client tries to connect to the host the exception keeps poping up on the host and prevents syncing.

The scene is on the build list and is loaded from the unity scene manager.

i’m using NGO version 1.8, parrel sync, default unity transport. The issue is still present in 1.7.1.

There is most likely an issue with the parrel Sync clone cache.
You will want to clear those or if you want to verify this is the issue create a new clone and test with that to see if the issue goes away.

deleted the old and created a new clone, same issue.

can’t seem to figure out clear the cache to give it a full clean.

There are two things you can do to verify if it is parrel sync or not:

  • Option 1:

  • Make a stand alone build and just test with two (or more) local stand alone build instances running.

  • Option 2:

  • Copy the following directories into a new directory (outside of your project’s current directory):

  • Assets

  • Packages

  • Once done, add that to your Unity Hub and open it as a new project

If it is specific to parrel sync, then either of the two should work and not throw that exception.

can’t seem to get the error to go away, i can’t find out how to clear the cache for the clones

Are you creating any scenes during runtime?
If not, could you post the full exception with the stack trace?

i figured out what my issue is.

It turns out that when i’m loading the scene, the initialization flow was taking too long that the client would disconnect from the host mid process. reconnecting it post load would expose that error; but further investigation found that our scene management was the problem. after reviewing our flow, the error is no longer appearing.

1 Like

Ahh… ok… glad you found the issue!

hello, im experiencing the same problem here on android, the only difference is i use play asset delivery with addressables.
and when the client tries to join i get the same error of couldnt be loaded because it has not been added to the build settings.
but if i make a build that doesnt use play asset delivery like a game that starts with the main scene the client connects without any problems.
i would love to know how you solved your problem and to get a little bit of help to maybe fix mine as well :smiley:

In my case I am using Niantic’s Network Manager. No Addressables. I was getting the same error. I unchecked ‘Scene Management’ under the Network Manager in the Inspector and now everything works. I’m not sure what exactly ‘Scene Management’ does, so unsure if I have broken something else.

If you are trying to use scene addressables then that is not supported by NGO currently and will give you an error about the scene not being in the build settings. NGO currently only supports addressable NetworkPrefab assets.

There are two settings in NetworkManager that you can adjust to prevent time outs for extended synchronization periods:

NetworkManager–> Spawn Timeout (NetworkManager.NetworkConfig.SpawnTimeout)
While a client is synchronizing, there could be a period of time where messages for “to-be-spawned” NetworkObjects are received by the client that is still synchronizing and has yet to spawn those NetworkObjects. This values determines how long (in seconds) any message targeting a “to-be-spawned” NetworkObject is deferred (kept in a cache). Upon the NetworkObject spawning, any messages targeting that NetworkObject will be processed. If the NetworkObject is never spawned (for various reasons…such as it was a retransmitted message that was re-sent just after the NetworkObject was despawned) then the message will be dropped.
Earlier versions of NGO defaulted to 1 second and any project created with an earlier version would be serialized as such. The new default Spawn Timeout period is 10 seconds. I would check to make sure this value is higher than 1 second and if it takes 5-10 seconds to synchronize then I might just bump that to like 30 seconds. The only cost of a longer Spawn Timeout period is the memory require to cache the messages (which typically shouldn’t be very large).

NetworkManager–> Load Scene Time Out (NetworkManager.NetworkConfig.LoadSceneTimeOut)
This is the period of time that the server/host will wait for all clients to have responded to a scene event before the client has been deemed “timed out”. The default for this is 120 seconds… if it is taking longer than 2 minutes to load a scene or synchronize then you would want to bump this value up accordingly.