Techshop

Unity Tutorial 7 - Creating some objects

Creating a surface, 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".

Off

unity-tutorial-7-1.png#asset:581

On

unity-tutorial-7-2.png#asset:582

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)

unity-tutorial-7-3.png#asset:583

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

We should then have the following

unity-tutorial-7-4.png#asset:584

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).

unity-tutorial-7-5.png#asset:585

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

unity-tutorial-7-6.png#asset:586

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

unity-tutorial-7-7.png#asset:587

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…

unity-tutorial-7-8.png#asset:588


Use the scroll wheel to zoom out.

And then select the near face

unity-tutorial-7-9.png#asset:589

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

unity-tutorial-7-10.png#asset:590

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

GIT TAG 003_AddedFloor

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.

unity-tutorial-7-11.png#asset:591

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

unity-tutorial-7-12.png#asset:592

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

unity-tutorial-7-13.png#asset:593

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.

unity-tutorial-7-14.png#asset:594

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:

unity-tutorial-7-15.png#asset:596

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.

unity-tutorial-7-16.png#asset:597

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…

Press play at the top...

unity-tutorial-7-18.png#asset:598unity-tutorial-7-19.png#asset:599

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

unity-tutorial-7-20.png#asset:600

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.

unity-tutorial-7-21.png#asset:601

Much better.

But… nothing's moving…

We need to attach some physics to these objects.

GIT TAG 004_AddCoin

Unity - A simple tutorial < Unity Tutorial 6 - Adding Some Plugins Unity Tutorial 8 - Physics >