So I been making progress working with dots and then I got clapped. So I have a asset project to build bundles for for my client and server project’s and the whole time in client and server project i’ve been iterating with subscene open and then i decided to make a build for the client and instantly noticed a huge no no.
So I went docs and noticed this?
“When a subscene is closed, Unity streams in the content of the baked scene. The entities in a closed subscene take a few frames to become available when you enter Play mode. In builds, subscenes behave the same as closed subscenes in the Editor, so their entities aren’t available immediately.”
So just closing the subscene in editor I was able to see same thing I saw in build and for like 2 days I been seeing if anyone else had my issue no help so I come here.
I currently have a static class static method that basically loads a bundle file from a directory and returns a Object
AssetBundle bundle = AssetBundle.LoadFromFile(resourcePath);
T prefab = bundle.LoadAsset<T>($"Assets/_SharedAssets/{_resourceName}/{_resourceAsset}");
So with this I get my GameObject example and bake entity into a resource component so i can spawn
GameObject player = AssetBase.Load<GameObject>("Default", $"Gameplay/Player.prefab");
GetEntity(player, TransformUsageFlags.Dynamic)
If the subscene is open everything work as expected but when it’s closed I get missing materials but when i look at the companion link i see some data is correct but the references are missing so visually things are pink which is a deal breaker for a game. I looked at docs again said to use urp forward+ and no luck there I tried a bunch of things.
I just want to know if there is a direct solution to fix this now or is it a bug because I can continue to work with subscene open and wait for a patch fix the alternative is to manage game assets for the client and server which will create bigger build sizes and project size and discrepancies in assets basically I would be doing double the work one asset at a time and longer waits for imports basically I don’t want to go back it’s too good on the other side.