- Home /
Answer by Bunny83 · Jul 04, 2011 at 02:59 AM
Just read the docs on the Mesh class carefully and you might want to download the procedural example project from the Unity example page
If you want to create a mesh just keep the following things in mind:
Before you can set any additional vertex information you have to set the vertices array.
All the other arrays like normals, tangents, uv, uv2, colors and triangles can be set afterwards but the size of the array have to match the vertices array size (except triangles of course)
The Mesh is always made up of triangles. That's why the triangle array size always have to be a multiple of 3 (3, 9, 27, 300, 12)
To see an example of how to use boneWeights, just take a look at the scripting reference.