Bouncy balls
The feature we'll implement here is, when a ball drops from mid-air and hits the ground, it bounces back up and down, and up again, diminished over time.
We are going to start simply with a new scene that consists of a ground plane and a sphere. Then, we'll add physics to it, a bit at a time, as follows:
- Create a new scene by navigating to
File
|New Scene.
- Then, navigate to
File
|Save Scene As...
and name itBallsFromHeaven
. - Create a new plane by navigating to
GameObject
|3D Object
|Plane
and reset its transform using theTransform
component's gear icon |Reset.
- Create a new sphere by navigating to
GameObject
|3D Object
|Sphere
and rename itBouncyBall
. - Set its
Scale
to (0.5
,0.5
,0.5
) andPosition
to (0
,5
,0
) so that it's above the center of the plane. - Drag the
Red
material fromProject Assets
(created in Chapter 2, Content, Objects and Scale) onto it so that it looks like a bouncy ball.
The new Unity scene defaults come with Directional Light
and Main Camera
. It's OK to use...