Game Development Reference
In-Depth Information
Figure 3-22. The new Physic material
3.
Once again, open the right-click menu in the Project view, or open the Assets
menu and select Import Package.
4.
Choose Physic Materials.
5.
In the Import dialog, note the folder location, note the Physic Materials folder
in the Standard Assets folder, and click Import.
6.
Open the folder, and click on each Physic material to see its settings in the
Inspector.
Fortunately, the materials have been given nice descriptive names for those of us to whom physics
remain a mystery.
7.
Drag and drop a different material directly on each cube in the Hierarchy
view. Put Bouncy on the top cube, Wood on the middle cube, and Ice on the
bottom cube.
8.
Select each object, and examine its collider's Material field.
The materials are added to the proper parameter automatically.
9.
Click Play.
This time the cubes react according to their individual physic materials, Bouncy bounces quite nicely.
Ice, having very little Static Friction, slides off as it lands, and Wood bounces lightly before settling.
This is a good time to experiment with the Rigidbody a bit more.
1.
Stop Play mode.
2.
Select the cube with Bouncy.
3.
Set its Mass parameter to 0.1 .
4.
Click Play.
 
Search WWH ::




Custom Search