Materials Loaded From Asset Bundles Appear Transparent Or Black

My project currently has some asset bundles with some materials using the standard shader in them, I load these asset at runtime, these assets are checked for being null and none of them are null, however when I want to Assign the material I Loaded from the asset bundle to the object, the material appear either Black or Completely Transparent (While being fine in the Editor)

Any way to solve this issue?

Hey Masiha,

Materials / Shaders are quite complex so it may not be easy to diagnose without seeing the project, but we’ll have a go!

The build-system compiles shader variants based upon their usage. If you’re not assigning the Material to an object ahead of building but you make that assignment later on, it may be that the specific shader variant it requires hasn’t been built. You could validate that’s the case by assigning it in the Editor and then building to see if it makes a difference.

Hopefully that gives you a jumping off point, but if you still have challenges feel free to create a bug and someone from our team can look into it.