Add physics to your game

Let's tap into Unity's built-in physics engine by adding a Rigidbody component to the Ball:

  1. Select the Ball from the Hierarchy panel.
  2. In the menu, navigate to Component | Physics | Rigidbody.
  3. A Rigidbody component is added to the Ball. You can see it in the list of the components of the Ball game object in the Inspector panel:
    Add physics to your game
  4. Make sure that the Rigidbody component's Use Gravity checkbox is checked in the Inspector panel.
  5. Press Play to test your game.
  6. Press Play again when you've recovered from how awesome that was.
    Add physics to your game

No way! When ...

Get Unity 4.x Game Development by Example 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.