- Home /
error in creating mesh script
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;
}
Just search Answers properly, this question was answered here multiple times. Look for mesh, creation, quad, code tags.
Your answer

Follow this Question
Related Questions
Ending my game 3 Answers
Why is this player script not working 1 Answer
Debug.Log error 2 Answers
Windows Script error upon opening a new javascript behavior script. 4 Answers
Unity compiler throwing fake errors? Something wrong with this script. 3 Answers