Default Sprite Material/Shader - Purple Color

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.

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

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.

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?

7110013--848203--Screenshot 2021-05-05 at 15.16.53.png

Or change them to target platform?

7110013--848206--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.

The pink/purple are because your target is android(In build setting). trying to load addressable built with the android target will result in broken shader. Try changing to the standalone target and build the addressable.

Here more information on this:

It for AssetBundle but addressable use AssetBundle under the hood

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.