Search Unity

Resolved Default Sprite Material/Shader - Purple Color

Discussion in 'Addressables' started by Gamrek, May 4, 2021.

  1. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Hello all,

    I am using the default material on my 2D objects and it works fine when I put the play mode as "Use Addressable database". However when I use existing build mode, my object become purple. And my 2D sprite renderer gives out a warning: Material does not have a _MainTex texture property.

    Screenshot 2021-05-04 at 22.27.46.png

    If I go on editor and pick the sprite/default shader again, everything refreshes and work fine. It seems like the shader/material doesn't get refreshed with they are loaded using "Addressables.InstantiateAsync". How do I fix that?



    Derek
     
  2. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    Is your build target pc,mac, linux standalone? if not addressable build the asset for ios/android and trying to load them in editor do not work.
     
  3. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Thanks, at the moment I switched to Android on Unity editor and want to include all the groups within the app (local) for testing only, then I will make one or two group as remote. Here is what I don't quite understand, should I change the group load and build path as local?

    Screenshot 2021-05-05 at 15.16.53.png

    Or change them to target platform?

    Screenshot 2021-05-05 at 15.16.40.png

    When I use LocalBuildPath and LocalLoadPath with "use existing build" on editor, all the 2D objects are shown as pink/purple.
     
  4. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
  5. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164

    Thanks, after several testings, I got it working. The reason why it didn't work is because of the URP which make the sprite didn't display correctly and I thought it was the addressable issue.