I’ve tried:
mat.mainTexture = texture;
//or
mat.EnableKeyword("_BaseColorMap");
mat.SetTexture("_BaseColorMap", texture);
I’ve even made a custom shader in Amplify with a custom texture property, and it still wouldn’t work.
I’m using this to get the material of the object:
Material mat = obj.GetComponent<MeshRenderer>().material;
Any idea why this wouldn’t be working?
Edit: I’m using 2019.4.11f1 by the way.
Edit 2:
Tried this as well.
Shader shader; //using created Shader
var mr = obj.GetComponent<MeshRenderer>();
var mat = new Material(shader);
mat.mainTexture = texture;
mr.material= mat;