Making a Cube | Unity Tutorial

To prototype a game in Unity, you can design a scene using primitives. To learn how to build 30 virtual reality games in Unity, check out our Unity 3D course! There are a number of primitives, or elements, that you can create in Unity, such as a cube.

Later, you can create more complex 3D elements in modeling programs, such as Blender. Then you can import the art into Unity.

Creating a 3D Primitive

To make a 3D element, right-click in the Hierarchy. A menu will appear containing listing game objects you can create. Clicking “Create Empty” would create a net game object, which has only a Transform component.

In the “3D Object” tab, there are names of three-dimensional shapes. Click on “Cube”, as in the next image.

“Cube” will appear in the Hierarchy. A cube will appear in the Scene, as you can see in the following image.

Cube’s Components

In the Inspector, there are many components for Cube. To position the cube in the center of the scene, change the X, Y, and Z Position values to 0.

If you change Cube’s X Scale value, Cube’s size will change in the X axis. Changing the Scale’s Y value makes the cube taller or shorter. The Z Scale value corresponds to the cube’s size in the depth axis, as evident in the following screenshot.

To change Cube’s scale visually, click on the fourth icon in the top left of Unity. Colored cubes will extend from Cube’s center. You can drag the cubes to change Cube’s size. If you click and drag the gray cube in the center of the cube object, Cube’s size will change in all three axes at once.

The Cube (Mesh Filter) component is the data for the 3D object that is rendered on the Scene. The Box Collider is used to process collisions.

The Mesh Renderer draws the cube. If you disable the Mesh Renderer by un-checking it, the cube will become invisible.

To learn more about the Mesh Renderer and Unity, check out our Unity 3D course, where you build 30 virtual reality games!

Author Profile

Alexandra Kropova
Alexandra Kropova
Writer of blog posts and books at Mammoth Interactive. Can also be found posting to Mammoth Interactive's social media.

Leave a Reply