Bouncy balls

In Unity, the physics behavior of an object is defined separately from its shape (mesh) and renderer (material). The Unity physics engine controls the positional and rotational forces that affect the transform of an object, such as gravity, friction, momentum, and collisions with other rigid bodies. The items that play into physics include:

  • Rigidbody component
  • Collider component
  • Physic material
  • Project Physics Manager

So, two things will be needed to make our ball bounce. It must have a Rigidbody component, so the Unity physics engine will know to apply forces to it. In particular, we want the ball to respond to gravity. Secondly, we will apply a physic material so the ball not only falls, but then bounces when it hits another ...

Get Augmented Reality for Developers 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.