Wouldn't it be fun to actually play with these bouncy balls? Let's make a game where you aim the ball at a target using your head as a paddle. For this game, balls drop one at a time from above and bounce off your forehead (face), while you try aiming for a target. To implement this, we will create a cube as a child of the camera object that provides a collider that tracks the player's head movement. I decided a cube-shaped collider would be better for this game than a sphere or capsule because it provides a flat surface that will make the bounce direction more predictable. For a target, we'll use a flattened cylinder. We'll also add sound-effect cues to indicate when a new ball has been released and when a ball has hit the target.
To begin, we can build on the previous scene, adding an XR Rig. To do that, follow the steps given next:
- Save the current scene named 09-2-BallGame by clicking File | Save...