Time for action – adding GameObjects and a button to the Scene

Add a Plane GameObject and a Cube GameObject to the Scene panel. Add a Rigidbody Component to the Cube GameObject so it will fall to the Plane GameObject. Also add a Directional Light to the Scene panel if there isn't one already. Then we'll add a GUI button to switch to the PlayState object. To do so, perform the following steps:

  1. In the menu, navigate to GameObject | Create Other | Plane.
  2. In the Inspector panel, make sure the Position is 0,0,0 for X,Y and Z.
  3. In the menu, navigate to GameObject | Create Other | Cube.
  4. Set the values in the Inspector panel as shown in the next screenshot.
  5. Select Cube in the Hierarchy panel.
  6. In the menu, navigate to Component | Physics | Rigidbody.
  7. In the menu, ...

Get Learning C# by Developing Games with Unity 3D Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.