In this chapter, we built a game that uses Unity's Physics Engine and a number of other features. First, we explained in layman's terms the relationship between Rigidbody, Colliders, and Physic Materials, and explored how the physics engine uses these to determine the velocity and collision of objects in the scene.
Then, we considered the life cycle of game objects and implemented an object pooler that helps avoid memory fragmentation and garbage collection, which can lead to performance problems and VR discomfort.
Using what we learned, we implemented several variations of a ball game, first aiming for a target with your head, then using hand paddles. We modified the game so that, instead of serving balls from above-using gravity, we shoot them from in front and apply a velocity vector. Lastly, we juiced up our game, changing the bouncy balls into fireballs...