Game Development Reference
In-Depth Information
We also use the
Physics.OverlapSphere()
funcion to check for all the colliders that
touch or get inside the explosion radius.
For more informaion about the
Physics.OverlapSphere()
funcion, you can go to the following Unity scriping document:
http://unity3d.com/support/documentation/
ScriptReference/Physics.OverlapSphere.
html?from=Rigidbody
.
Classified Intel
In this step, we have used the
Rock Physics Material
apply to the Box Collider material in
the cube, to which we can apply the fricion and bounciness value for each object to get a
realisic reacion when calculaing the physics.
For the
Rock Physics Material
, we set the
Dynamic Friction
to
0.3
and
Static Friction
to
0.3
,
which will make each piece have some small fricion when it collides with another, because
we don't want the rock too slippery or too hard to move. Since we don't want each piece of
wall bouncing, we set the
Bounciness
to
0
, as shown in the following screenshot:
For more details, you can go to the Unity website at:
http://unity3d.com/support/documentation/
Components/class-PhysicMaterial.html
.