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

Imported model from assetbundle doesn't look right

Discussion in 'General Graphics' started by lyze237, Feb 3, 2017.

  1. lyze237

    lyze237

    Joined:
    Jan 4, 2016
    Posts:
    5
    Hello!

    Whenever I create a prefab from a model in a scene and add this to an assetbundle and load it afterwards dynamically it doesn't look right, doesn't cast shadows and is generally darker.



    The left one is the model from the assetbundle and the right one is the model which is already in the scene.

    The model itself has "receive shadows, cast shadows" turned on:
    (Top Assetbundle; Bottom original)



    The textures look also weird in the inspector for some reason although have the same settings.



    The way I load the model from the bundle:


    Code (CSharp):
    1. WWW www = WWW.LoadFromCacheOrDownload("<file>", 1);
    2. yield return www;
    3.  
    4. AssetBundle bundle = www.assetBundle;
    5.  
    6. AssetBundleRequest request = bundle.LoadAllAssetsAsync<GameObject>();
    7. yield return request;
    8.  
    9. foreach (Object asset in request.allAssets)
    10. {
    11.     GameObject obj = asset as GameObject;
    12.     if (obj != null)
    13.     {
    14.         Instantiate(obj);
    15.     }
    16. }
    I'd highly appreciate it if somebody could help me!
     
  2. DJgray3D

    DJgray3D

    Joined:
    Mar 6, 2013
    Posts:
    15
    Hi,
    I'm experiencing the same problem now.
    Did you find a solution?
     
  3. lyze237

    lyze237

    Joined:
    Jan 4, 2016
    Posts:
    5
    Hey!

    I've fixed the issue by baking the lightning manually before importing. I don't really know why this helped but it did.