The Unity Physics engine
Unity has a Physics engine integrated into it, which is able to handle both kinematic and dynamic types of rigid bodies as well as other physical entities such as clothes. It is divided into two parts: 2D Physics and 3D Physics. It's important to understand that although they can coexist together in the same scene, they are two separate entities; they cannot communicate between themselves. Physical objects under 2D Physics will not interact with physical objects under 3D Physics.
In this section, we will explore most of the 2D Physics engine of Unity. Although we will not use all the components presented here, it's important to master them all to become a better Unity developer.
Understanding Physics in Unity
In Chapter 2, Cooking Cupcake Towers, we learnt about script ordering and how it is executed. The first question we may wonder is when does the Physics engine occur when a frame is rendered? The answer is not straightforward, because the Physics engine runs multiple...