Hello, i wanna know how it is possible to color a custom mesh triangles per triangles. Like if it where : Code (CSharp): mesh Mesh; Vector3[] verticles = new Vector3[10]; int[] triangles = new int[verticles.Length * 3]; void Start() { mesh = new Mesh(); GetComponent<MeshFiter>().mesh = mesh; //set verticles and triangles values... for (int i = 0; i < triangles Length; i++) { if (i = 0) { triangle[i].color = Color.red; } else { triangle[i].color = Color.blue; } } mesh.vertices = verticles; mesh.triangles = triangles; } This exemple is for color only one triangle of the mesh (there it is the triangle number 0). Thanks you for help...
Triangles don't have any property of their own (color, position, normal, etc). They're just triads of indices into the vertex array. Vertices however, can have colors. So you can give each vertex in your mesh a color, and they will be interpolated across triangle faces. See: https://docs.unity3d.com/ScriptReference/Mesh-colors.html Note that in order to actually see the vertex colors, you need to render the mesh using a shader that doesn't ignore them. Most Unity built-in shaders will ignore vertex colors.