I have read the documentation, and used their code (Unity - Scripting API: Mesh).
I have an empty game object with a mesh filter and a mesh renderer. When I run it, I get a pink square.
I have attached this script to this game object:
public Vector3[] newVertices;
public Vector2[] newUV;
public int[] newTriangles;
void Update() {
Mesh mesh = GetComponent<MeshFilter>().mesh;
mesh.Clear();
mesh.vertices = newVertices;
mesh.uv = newUV;
mesh.triangles = newTriangles;
}
When I use these settings, my pink square vanishes (instead of changing):
I get the warning "Shader wants texture coordinates, but the mesh Quad Instance doesn’t have them. I have tried with other meshes, and it is still the same error. (No mesh just draws nothing from the beginning.)
The code is pulled directly from the documentation. Where am I going wrong?