I'm trying to change the color/material of the faces on my object at runtime. My object has a default SpatialMappingWireframe to begin with:
And I'm trying to assign new colors on start like so:
void Start()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;
Color[] colours = new Color[mesh.vertices.Length];
for (int i = 0; i < mesh.vertices.Length; i++)
{
colours[i] = Color.red;
}
mesh.colors = colours;
Debug.Log($"Colour Count: {colours.Length}");
}
I can see the debug line being output, but no changes to my scene:
Apologies if I'm missing something obvious