Using Physic Materials

Simon Pham
3 min readMay 3, 2024

--

In today’s blog post, let’s explore physic materials in Unity.

What is a physic material?

In Unity, physic materials are used to define the interaction of surfaces when they come into contact, specifically how they slide against each other and how they bounce off each other. This material can be attached to any collider component to alter the physics properties of the surface of the GameObject to which it’s applied.

Physic material demonstration

Scene setup

I’ve set up a scene with a container and a slope. Our objective is to apply physic materials to both objects so that the container will slide down the slope.

Adding physic materials

In a physic material, there are a few properties that we can adjust including Dynamic Friction, Static Friction, Bounciness, Friction Combine, and Bounce Combine.

Dynamic Friction is a property that determines the resistance encountered by one surface sliding over another, while Static Friction is similar but applies when the surfaces are not moving relative to each other. For both properties, the higher the value, the more resistant the object will be.

Bounciness determines how elastic a collision is between two objects. A bounciness of 0 means the object will not bounce at all, while a value of 1 means the object will bounce indefinitely.

Friction Combine and Bounce Combine properties dictate how the friction and bounciness of two colliding objects are calculated, respectively:

  • Average: The friction/bounciness is the average value of both materials.
  • Minimum: The friction/bounciness is the minimum value of the two materials.
  • Maximum: The friction/bounciness is the maximum value of the two materials.
  • Multiply: The friction/bounciness values of the two materials are multiplied together.

With the knowledge we’ve just learned, let’s create two physic materials for our objects, which I’m going to call Smooth Metal and Rough Metal. To create a physic material, right-click in the Project window and select Create > Physic Material, then rename it.

Here are my settings for the Smooth Metal material:

Here are my settings for the Rough Metal material:

To apply the Smooth Metal material to the container, simply drag it into the Material field in the Box Collider component of the container.

Let’s do the same for the slope.

And here’s the result:

--

--