Physics Materials

All physical objects have varying properties, which help make up their different surface types and how they interact with other objects. Imagine being hit in the head with a beach ball. Now imagine instead that it is a piece of wood. A beach ball’s physical properties will behave (and feel) quite different from the wood’s. This constitutes their physical properties.

Unity allows you to create physics Materials for both 3D and 2D colliders. Physics Materials affect only 3D colliders, while the Physics 2D are for 2D GameObjects. There are only two attributes for the Physics 2D Materials: Friction and Bounciness, as shown in Figure 7.6.

Figure 7.6 Example of a physics Material

Let’s create a few physics Materials that we can ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation 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.