Collisions and Health: Detecting Collisions Accurately
As games try to simulate real-world behaviors, one important aspect of simulating is physics, which dictates how objects move and how they collide with each other, such as the collision of players and walls or bullets and enemies. Physics can be difficult to control due to the myriad of reactions that can happen after a collision, so we will learn how to properly configure our game to create physics as accurately as we can. This will generate the desired arcade movement feeling based on realistic collisions—after all, sometimes, real life is not as interesting as video games!
In this chapter, we will examine the following collision concepts:
- Configuring physics
- Detecting collisions
- Moving with physics
First, we will learn how to properly configure physics, a step needed for the collisions between objects to be detected by our scripts, using new Unity events that we will learn. All of...