字幕列表 影片播放
Physic Materials are materials that instead
物理材質(Physic Material)
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
物理材質可點選專案裡的Create鈕來建立
in their mass, their surfaces are also
從檢視裡調整和其它表面互動的設定
very different and they react to other
利用摩擦力的設定來控制互動的結果
surfaces very differently. Physic materials
動態摩擦(Dynamic Friction) 用來設定物件移動產生的摩擦力
can be created from the Create button
靜態摩擦(Static Friction)用來設定 從靜止狀態移動一個物件需要多少力量
on the project panel.
彈力(Bounciness)設定物件的彈力大小
And they're edited in the inspector to
綜合摩擦(Friction Combine) 設定物件對其它物件材質的反應
control how the surface reacts to another
摩擦方向(Friction Direction) 設定各軸向的摩擦力
surface. They do this by controlling friction.
而動態摩擦 2和靜態摩擦 2 是用來控制摩擦方向的三個軸向數值
Dynamic Friction is how much friction
在這個範例裡 我們將方體和工作臺加入了物理材質
exists whilst the object is moving
物理材質可在物件碰撞體屬性裡指定
and Static Friction is how much
你可以在碰撞體元件裡 看到一個指定物理材質(Materia)的設定
force is required in order to move the
當開始播放遊戲時 方體物件顯得滑溜又略有彈力
object from a static position.
那是因為我的動態摩擦和靜態摩擦設定為 0
Bounciness does exactly what it sounds like.
代表平滑表面上沒東西阻止的了它 同時也帶了些許彈力
It controls how bouncy the object is.
如果我將彈力設定提高它就會彈離工作臺
And the Friction Combine settings control
如果我想限制它在X軸的摩擦力
how they respond to another object
我可以在物理材質檢視裡
with a certain material. Friction Direction
將摩擦方向的X軸設定為1 並加大動態摩擦2的數值
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.