-
Physic Materials are materials that instead
-
of effecting the appearance of a game object
-
they effect the way that the object reacts
-
to the physics engine. Consider the difference
-
between how a basketball and a bowling ball
-
might bounce. Whilst there is a difference
-
in their mass, their surfaces are also
-
very different and they react to other
-
surfaces very differently. Physic materials
-
can be created from the Create button
-
on the project panel.
-
And they're edited in the inspector to
-
control how the surface reacts to another
-
surface. They do this by controlling friction.
-
Dynamic Friction is how much friction
-
exists whilst the object is moving
-
and Static Friction is how much
-
force is required in order to move the
-
object from a static position.
-
Bounciness does exactly what it sounds like.
-
It controls how bouncy the object is.
-
And the Friction Combine settings control
-
how they respond to another object
-
with a certain material. Friction Direction
-
will allow you to control friction
-
in a particular axis and the dynamic
-
and static friction 2 properties
-
will give you control over those three axes.
-
In this example we've applied this
-
particular physic material to our power cube
-
and our work bench.
-
The physic material is applied to the
-
collider in any given game object
-
and you can see that there's a slot for
-
material within the collider settings.
-
You can see that if I press play,
-
it bounces slightly and is also very slippery.
-
This is because I've used 0 for dynamic
-
and static friction, meaning there's nothing
-
stopping it from slipping around and
-
I've also made it slightly bouncy.
-
If I make it very bouncy
-
then it's going to bounce off of the table.
-
And for example if I wanted to restrict
-
it's movement in a particular axis
-
so I can see that the X axis is the direction
-
in which it's sliding, so what I could do
-
is go back to that material and I'll set
-
my friction direction of X to 1 and
-
increase the dynamic friction. I'm going to turn
-
bounciness back down to a lower number
-
so that it doesn't bounce off the table.
-
And you can see that it's slowing to a halt
-
because of the amount of friction involved there.
-
So we could make that slightly lower
-
and you can see it begins to slide.
-
So hopefully you can see that with
-
physic materials you can completely control
-
the surface of an object
-
and how it responds to others.