Building the game environment

Before we begin construction, we will set up the snap values. GameObjects can be constrained to move, scale, or rotate according to the snap setting. This is a very useful technique for setting the relative positions of objects.

When positioning objects we'll use one of three techniques:

  • Grid snapping (Control-drag): This method will transform the object using the snap settings. These values are set in the Snap Setting... dialog.
  • Vertex snapping (v-drag): This method snaps the currently selected vertex to a vertex on a second object. Hitting the V key will turn on the closest vertex.
  • Surface snapping (Control-Shift-drag): This method will be your best friend. After selecting an object, this keystroke will display a square gizmo at the object's center. Grabbing this widget will snap the object to a surface on the nearest GameObject.

Using the Snap settings is a time-saver for constructing the gameplay environment. It speeds up the building process by making it easier to align objects in 3D space. Follow these steps to setup snapping and start the construction process: 

  1. Choose Edit | Snap Settings... from the application menu. The Snap feature will let us snap the transform settings to predetermined increments:
Figure 7.8: Set the Snap settings before constructing GameObjects
  1. Create an empty GameObject at the root level of the Hierarchy panel. Rename the GameObject to Environment and position it at (0,0,0). We will use it to house the environmental assets.
  2. Move the Ground asset we created earlier into the Environment GameObject and set its material to BackgroundGrey.
  3. Save the scene.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.78.252