Part 07 - Creating some objects.

By Jamie Chatterton / June 12, 2018

Creating a 'floor'

To open the ProGrids window go to Tools > Window > Progrids > ProGrids window.

Turn on ProGrids Snapping. The third button down in the "Scene" view, in the top-left. Turn this to "On".

Snapping off
Turning snapping off

Snapping on
Turning snapping on

To open the ProBuilder window go to Tools > Window > Probuilder > ProBuilder window

In ProBuilder, click on "New Shape" (It should default to text mode instead of icon mode.)

Probuilder window
Probuilder window

For now, just create a 1x1x1 cube, by clicking on Create Cube.

We should then have the following:

Cube
Our created cube

We're going to extend this cube into a flat surface by extending the surface

Click on the right-most tool, that looks like a flat-surface, at the top of the Scene view (these are part of ProBuilder, not Basic Unity).

ProBuilder tools
ProBuilder tools

These tools allow you select different parts of an object, "Whole object", "Vertex" (Point), "Edge", "Face".

We're going to select a "Face" of the cube, and drag it.

So, Select the right-most tool, the "Face" tool. So we have

Face tool
Face tool

And then select the cube, then the left-face of the cube…

Selecting cube
Selecting the cube

Now we can drag the face of the cube away, using the 'Red' (X) arrow, to extend that side of the cube… so to make it 6 units long…

Stretching cube
Stretching the cube

Use the scroll wheel to zoom out.

And then select the near face

Selecting near face
Selecting the near face

And drag the blue arrow (Z), to drag it away again, to make it into a rectangular surface…

Creating the floor
Creating the floor from the cube

Let's rename it something more sensible!. In the Inspector, name it "floor"

Git repository: https://bitbucket.org/hiveit/unity-tutorial-coin/src/003_AddedFloor/

Creating a 'coin'

Let's make a 'coin'

We can use the ProBuilder tools to make a coin now.

Using 'New Shape' again.

However, instead of a cube, we want to create a 'Cylinder'.

Also We want to change the 'height' to 0.1.

Click on Build Cylinder to create it….

But we can't see it, it's behind the "Cube" object we created.

Cylinder behind floor
The cylinder is behind the cube

To move the Cylinder, Click the "Object Selection" tool

Object Selection tool
Object Selection tool

And move it up the screen using the Green arrow, the 'Y' direction indicator.

Moving the cylinder
Moving the cylinder

Also, zoom in on the cylinder, using the mouse wheel, you will see a blue, red and green coloured 'cube' surrounding the 3D 'axes'. These around you drag in two axes instead of 3.

Dragging the cylinder
Dragging in two axes

To move it around the XZ axes, and not in Y, you can drag the green square, and place it above the floor object, cos we want it to drop on it in a moment.

Moving it around to roughly the position shown here:

Cylinder final position
Moving the cylinder to the final position

Everything's a little bright, let's turn the light down a little…

Select the "Directional Light" in the Hierarchy. In the "Inspector" find the "Intensity" value, and turn it down a little.

Dimming light intensity
Dimming the light intensity

You can enter a value directly, or if you hover the mouse to the left of the Input box, you get a cursor with little left-right arrows and you can change the value by holding the mouse button and dragging left-right.

Press play… Just to see what happens…

Play button
Press play at the top
Game playing
The game playing

Ah… the Camera needs moving… "Why's it RED?" I changed my editor to show red when it's playing so I don't forget it's playing !!!! (There's a reason I'll explain later!).

Anyway… move the camera…

Find a view you like… I kinda like this

Moving the camera
Moving the camera

Select the Camera in the Hierarchy.

In the GameObject menu, select "Align With View" to make the currently selected object align its position and the direction it's facing with the view in the current scene.

Now… press play.

Game playing again
The game playing with new view

Much better.

But… nothing's moving…

We need to attach some physics to these objects.

Git repository: https://bitbucket.org/hiveit/unity-tutorial-coin/src/004_AddCoin/

More posts in this series.