Failed setting triangles. Some indices are referencing out of bounds vertices. is the error im new to creating meshes but i think the problem is the variables on the top i dont know what to put in them, i want to create a plane do i put 3 vertices and 2 triangles ?? and whats do i do for xyz
var newVertices : Vector3[];
var newUV : Vector2[];
var newTriangles : int[];
function Start () {
var mesh : Mesh = new Mesh ();
GetComponent(MeshFilter).mesh = mesh;
mesh.vertices = newVertices;
mesh.uv = newUV;
mesh.triangles = newTriangles;
}
↧