Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Why my SubScene does not appear in the build?

Discussion in 'Entity Component System' started by AbrakaDabraSutra, Apr 26, 2023.

  1. AbrakaDabraSutra

    AbrakaDabraSutra

    Joined:
    Sep 3, 2021
    Posts:
    6
    I have successfully built a ECS project. The only problem is that it does not appear that the sub scene is loaded when I launch the .exe.

    My sub scene works in the editor and has the "auto load scene" checker checked. It does not matter if I include the subscene in the "Scenes in Build" in the Build Settings or not. The project itself is executable (I have a particle system outside of the subscene that works when the app is launched), but no objects from the sub scene are loaded.

    I have discovered this message in the logs:

    "Could not open file D:/Unity_Builds/Bakalarka/Bakalarka_Data/StreamingAssets/EntityScenes/f117b4a94c9ff034badc075715b8d3dc.entityheader for read

    Loading Entity Scene failed because the entity header file couldn't be resolved: guid=f117b4a94c9ff034badc075715b8d3dc."

    I am using URP (rendering path set to forward+) and entities.graphics is included.

    Unity version 2022.2.15f1, entities 1.0.0-pre.65

    I honestly don't know where to start debugging this. Does anyone have any tips. please?
     
    XiangAloha and oblivion1818 like this.
  2. oblivion1818

    oblivion1818

    Joined:
    Aug 29, 2013
    Posts:
    4
    I would love an answer to this as well. The only work around I have found so far is to switch to HDRP.
     
  3. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    288
    It's been a while, did the situation change for you?

    I'm having this problem too and don't know why.

    My setup:
    - Some subscenes
    - 1 true scene named "entity_scene" contains those subscenes
    - 1 true scene named "main_scene" acts as the starting point of the game
    - The 2 true scenes are included in the Build Settings.

    The process:
    - First, the game loads "main_scene" at start
    - After "main_scene" is available, I use SceneManager.LoadSceneAsync to load "entity_scene"

    Expected result:
    - Subscenes inside "entity_scene" are loaded into the default world.
    - The build and the editor work the same.

    Actual result:
    - On editor subscenes are loaded as expected.
    - On the build, subscenes are not loaded.

    Comparison:
    NetcodeSamples does use SceneManager.LoadSceneAsync, and it works even on the build.

    Investigation:
    According to this, inside the StreamingAssets folder of the build, I see only UnityScenes folder, but no ContentArchives.
     
    Last edited: Aug 4, 2023
  4. XiangAloha

    XiangAloha

    Joined:
    Jun 19, 2020
    Posts:
    11
    +1 Exact same problem
     
  5. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    263
    Maybe the subscenes aren't loaded because they weren't included in the build? Can you verify that the subscene data exist in
    Bakalarka_Data/StreamingAssets/EntityScenes
    and
    Bakalarka_Data/StreamingAssets/ContentArchives
    ?

    I think Unity looks for (active) Subscene components in scenes that are included in the build. I've noticed similar loading errors when the Subscene component is on an inactive GameObject (at build time).

    Note that you don't need to include the subscenes themselves in the build settings.
     
  6. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    288
    Curiously I include all the true scenes in Build Settings (not the subscenes themselves). But the ContentArchives is not there.
     
  7. Tagaris

    Tagaris

    Joined:
    Apr 21, 2013
    Posts:
    10
    Same issue here.

    I'm using Unity 2023.1.5f1 and entities 1.0.11. In the editor it all works well. However, when building and running the standalone the sub scene is not loaded. I'm using the regular "Build and Run" dialog - that should be supported in 1.0 from what I've read (right?). I have included all the scenes and sub scenes in the build settings and they are included in the StreamingAssets/EntityScenes and /ContentArchives folders (at least some files are there).

    I am using URP (rendering path set to forward+) and entities.graphics, too.
     
    Last edited: Aug 9, 2023
  8. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    288
    2023.1 does not support ECS. Use 2022.3 instead.
     
    Tagaris likes this.
  9. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    288
    Upgrade to 2022.3.6 fixed my issue.
     
    XiangAloha likes this.