I’m just trying to set the color of a material at runtime. The C# docs aren’t great.
MaterialOverride.Set("albedo_color", new Color(1f, 1f, 1f));
>Solution :
That should be (tested):
((SpatialMaterial)MaterialOverride).AlbedoColor = new Color(1f, 1f, 1f);
You would get NullReferenceException if you let SpatialMaterial initialized. You would get a InvalidCastException if it isn’t a SpatialMaterial (it could be ShaderMaterial).