Here is the script…
var newVertices : Vector3;
var newTriangles : int;
function Update () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
mesh.Clear();
// Do some calculations...
mesh.vertices = newVertices;
mesh.triangles = newTriangles;
}
I then make 4 vertices and 4 faces as a pyramid, but I can only see a single triangle.
Any help is very much appreciated.
Also, I already read the Unity Scripting Reference, and I didn’t see this mentioned.