Search Unity

Question Pink FBX after downloading AssetBundle

Discussion in 'Editor & General Support' started by R0tmayer, Jul 27, 2021.

  1. R0tmayer

    R0tmayer

    Joined:
    Mar 13, 2021
    Posts:
    12
    Hi everyone!

    I'm trying to download assetBundle from server and unzip it. But prefab just has PINK COLOR (screenshot link)

    I tested 5 different shaders (type of material):
    1. Standard (working)
    2. Mobile/BumpedDiffuse (not working, pink material)
    3. Mobile/VertexLit (working)
    4. ProBuilder/ReferenceUnlit (not working, pink material)
    5. Mobile/Particles/Multiply (not working, pink material)
    When Prefab from AssetBundle instantiated on the Scene you can see attached material on this prefab. And there are attached texture map on this material. So problem is not like: "Maybe material is not attached to prefab or texture is not attached to material, check it...":)

    And the most interesting thing that if i changed shader (type of material) to any other all is fine.

    Like if I click to prefab which has already downloaded and instantiated in Scene and changed attached to this prefab material from Mobile/BumpedDiffuse to Mobile/BumpedDiffuse or from ProBuilder/ReferenceUnlit to ProBuilder/ReferenceUnlit the shader will change from pink to the material I want

    In general, watch my video.

    Thank you!
     
    Last edited: Jul 28, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Most likely this is a build target mismatch.

    Bundles made for iOS and Android cannot be run in the Unity editor (generally they show up pink), plus they will only work properly on their respective hardware targets.

    If you want to test A/B in the Unity editor, build them for standalone.
     
    R0tmayer likes this.
  3. R0tmayer

    R0tmayer

    Joined:
    Mar 13, 2021
    Posts:
    12
    It is really working. The problem was in BuildTarget.Android. I change it to BuildTarget.StandaloneWindows64 and it is helped me. Thank you Kurt-Dekker, about 15 days no one helped answer xD:D
     
    Kurt-Dekker likes this.
  4. mesmes123

    mesmes123

    Joined:
    Oct 11, 2021
    Posts:
    9
    Same happened to me !
    I had a Unity WebGL project, I was struggling to understand why the asset bundles I am loading to my editor are pink although they got the correct material !
    This was the build pipline code from my create asset bundle script:
    Code (CSharp):
    1.     BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.WebGL);
    As you suggested this was happening JUST IN EDITOR and worked fine after build.