Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Why the SubScene not Baking in the Android build ?

Discussion in 'Entity Component System' started by FriedrichNietzsche, Mar 29, 2023.

  1. FriedrichNietzsche

    FriedrichNietzsche

    Joined:
    Mar 18, 2023
    Posts:
    7
    In my Unity project using unity 2022.2.8f1 & DOTS 1.0.0-pre.65,
    1- I have a scene that contains a subscene which Loads & Bakes correctly in the editor, but fails to Bake in the built version because I'm using game object prefabs that are stored and referenced in hierarchy within a list. I believe that Unity is attempting to bake before assigning the prefabs to the list in Awake when the app is running.
    2- Is it possible to load a subscene during runtime instead of having it autoload when the main scene loads?
    3- Are there alternative methods to convert game objects to entity prefabs in Unity, besides using subscenes?

     
    Last edited: Mar 31, 2023
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,753
    It probably won't fix your issue, but i just want to note you shouldn't include sub scenes in build settings
     
    FriedrichNietzsche likes this.
  3. boyaregames

    boyaregames

    Joined:
    Jun 23, 2021
    Posts:
    73
    I am having this issue in webgl right now
     
    FriedrichNietzsche likes this.
  4. FriedrichNietzsche

    FriedrichNietzsche

    Joined:
    Mar 18, 2023
    Posts:
    7
    it seems like I have identified the issue with my subscene.
    The subscene appears to be loading correctly in the Android build, but I'm experiencing problems with baking.
    This could be due to the fact that I'm using game object prefabs that are stored and referenced in the main scene hierarchy within a list.
    I believe that Unity is attempting to bake before assigning the prefabs in Awake when the app is running, which is causing Null Reference Exceptions. Do you have any suggestions for how I can resolve this issue?
    _______
    Resolved the error by moving the lists of the GameObject prefabs references from the main scene to the subscene.
     
    Last edited: Mar 31, 2023