Search Unity

Missing prefab in nested prefabs when changing build target and/or color space

Discussion in 'Unity Collaborate' started by staggeredPigeon, Apr 8, 2021.

  1. staggeredPigeon


    Dec 16, 2020
    In our project we have 2 scenes, one for WebGL and one for Desktop. We keep most of the assets in a ScenePrefab and share it across the two scenes. When changing build targets (Desktop -> WebGL or vice versa) or color spaces (in Player Settings) occasionally some of the nested prefabs within the scene prefab with load with "missing prefab". When this happens important elements are missing from the scene. This is of most concern when it happens with our build automation:


    I just had a build where the floor was missing from my WebGL build causing the player to fall indefinitely.
    We are using 2019.4.18f1.

    This problem can happen during manual build with the editor open when changing build targets and/or color settings. This is the first time I have seen it in the automated builds. When it does happen I close the editor and delete the Library directory in my project. It seems to happens less often if I don't have a scene with the scenePrefab opened when changing build target and/or color space.

    Here is a snapshot of our ScenePrefab in the VR scene.
    The problem happens quite a bit on the Launcher_Enclosure. When it does only the Launcher_Bolts are under the prefab. Everything else says "missing prefab".

    Any recommendations on how to avoid the problem are welcomed.