Complete the code to create a new Mesh object.
Mesh mesh = new [1]();We create a new Mesh by calling new Mesh(). MeshRenderer is a component, not a mesh object.
Complete the code to assign the mesh to the MeshFilter component.
GetComponent<MeshFilter>().[1] = mesh;The MeshFilter component has a mesh property where we assign the Mesh object.
Fix the error in the code to add a MeshRenderer component.
gameObject.AddComponent<[1]>();To render the mesh, we add a MeshRenderer component to the GameObject.
Fill all three blanks to create vertices and assign them to the mesh.
Vector3[] vertices = new Vector3[] { [1], [2], [3] };
mesh.vertices = vertices;Vertices define points in 3D space. Here, we create three points at (0,0,0), (1,0,0), and (0,1,0).
Fill all three blanks to define triangles for the mesh.
int[] triangles = new int[] { [1], [2], [3] };
mesh.triangles = triangles;Triangles are defined by indices of vertices. Here, the triangle uses vertices 0, 1, and 2.
