Unity 4.x Game Development by Example Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Understanding the gravity of the situation

Unity's built-in physics engine is ready for you to hook into it, but it will ignore your game objects unless you opt to add a component like Rigidbody to your game object. The Rigidbody component is so-named to differentiate it from soft body dynamics, which are calculations that actually distort and deform your meshes.

Note

Unity's Gone Soft

Soft bodies like cloth are partially supported in Unity 4.x, after numerous developers requested the feature. You can view and vote on upcoming Unity features here:

http://feedback.unity3d.com/

Rigidbody dynamics treat all of our objects as if they're made of wood, steel, or very stale cake. Collider components tell Unity when game objects crash into each other. As both our Ball and our Paddle already have sphere- and cube-shaped colliders surrounding their meshes, the missing link is the Rigidbody component. By adding a Rigidbody component to the Ball, we include the Ball in Unity's physics calculations. The result is hot ball-on-paddle action.