0
0
Unityframework~10 mins

Mesh and mesh renderer in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new Mesh object.

Unity
Mesh mesh = new [1]();
Drag options to blanks, or click blank then click option'
AMeshRenderer
BGameObject
CMesh
DMaterial
Attempts:
3 left
💡 Hint
Common Mistakes
Using MeshRenderer instead of Mesh
Trying to create a GameObject instead of a Mesh
2fill in blank
medium

Complete the code to assign the mesh to the MeshFilter component.

Unity
GetComponent<MeshFilter>().[1] = mesh;
Drag options to blanks, or click blank then click option'
AgameObject
Bmaterial
Crenderer
Dmesh
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning to material instead of mesh
Using renderer property which belongs to MeshRenderer
3fill in blank
hard

Fix the error in the code to add a MeshRenderer component.

Unity
gameObject.AddComponent<[1]>();
Drag options to blanks, or click blank then click option'
AMeshRenderer
BMesh
CMaterial
DMeshFilter
Attempts:
3 left
💡 Hint
Common Mistakes
Adding MeshFilter instead of MeshRenderer
Trying to add Mesh or Material as a component
4fill in blank
hard

Fill all three blanks to create vertices and assign them to the mesh.

Unity
Vector3[] vertices = new Vector3[] { [1], [2], [3] };
mesh.vertices = vertices;
Drag options to blanks, or click blank then click option'
Anew Vector3(0, 0, 0)
Bnew Vector3(1, 0, 0)
Cnew Vector3(0, 1, 0)
Dnew Vector3(0, 0, 1)
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same vertex twice
Using invalid Vector3 syntax
5fill in blank
hard

Fill all three blanks to define triangles for the mesh.

Unity
int[] triangles = new int[] { [1], [2], [3] };
mesh.triangles = triangles;
Drag options to blanks, or click blank then click option'
A0
B1
C2
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using indices out of range
Not providing exactly three indices