Search Unity

Rendered to Pink When Loading From Asset Bundle

Discussion in 'Asset Bundles' started by Kalita2127, Aug 6, 2019.

  1. Kalita2127

    Kalita2127

    Joined:
    Dec 6, 2014
    Posts:
    279
    Hi, I just did a simple test to load a scene from an asset bundle. Basically what I did is building asset bundle > uploaded them to the firebase storage > download them > and load a scene. But strangely the loaded scene becomes pink like in the picture below.

    The loaded scene contains default game objects like camera and directional light without any script included.
    Any help will be appreciated. Thanks !
     
  2. Kalita2127

    Kalita2127

    Joined:
    Dec 6, 2014
    Posts:
    279
    Seems like the editor can't load the shader from the asset bundle. I tried building it to android and it's just fine.
    I hope Unity would be able to fix this in the future.
     
  3. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
  4. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    The editor can load shaders from asset bundles, if the bundles are built for the editor. It cannot load shaders that are built for Android in the Editor, they show up as pink.

    At the same time, make sure you are not ending up with shaders being duplicated across bundles, that will result in shaders failing to load. You can use the analysis rule for bundle dependencies for that.
     
  5. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Yes, thank you. I did not come back here, you are right I was simply seeing the editor version with the android bundles => pink.

    I felt into this trap because I previously had the same pink issue on an Android device, for an unrelated reason I assume.