In this lesson, you will learn how to use Physical Materials to control how objects behave when they interact with different surfaces in your game world.
Understanding Physical Materials
By default, all surfaces in Unreal Engine share the same basic physical properties. However, in a realistic world, a character walking on ice should slide differently than one walking on sand, and a ball bouncing on concrete should react differently than a ball hitting rubber. A Physical Material acts as a data container that defines these specific behaviors.
Defining Core Properties
When you create a Physical Material asset in your Content Browser, you gain access to three critical settings that dictate physical surface interaction:
- Friction: This determines how much "drag" an object experiences when sliding across the surface. A low value makes the surface slippery, while a high value makes it grabby.
- Restitution (Bounciness): This controls how much kinetic energy is retained during a collision. A value of
0means the object stops dead on impact; a value of1means it bounces back with full energy. - Density: This defines the mass per unit volume, which is essential when your objects need to react to gravity or physics impulses accurately based on their size.
Assigning Materials to Surfaces
Once you have created your material with the desired settings, you need to link it to your geometry. You can do this in two ways:
- At the Asset Level: Open your Static Mesh and find the Phys Material slot within the Collision settings. Assign your material here, and every instance of this mesh will automatically use those physical properties.
- At the Component Level: If you have a specific floor or wall in your scene, you can select the Actor and override the
Phys Materialdirectly in its collision settings.
For example, if you set the Friction to 0.1 and Restitution to 0.8 on an "Ice" material, any Physics Body that collides with an object using this material will slide significantly further and bounce more vigorously compared to a "Stone" material with high friction and low bounciness.
Key Takeaway: Physical Materials allow you to decouple surface physics from geometry, enabling you to define unique friction, restitution, and density values that dictate how physics-enabled objects interact with your game world.