Adding Edge Collision and Gravity behaviors to a ball
Combining simulation behaviors can create some complex animation. Let's take a look at how we can make a ball bounce around our Canvas.
How to do it...
Double-click to open the
03_05
project.Press the Space bar to start the playback. This project consists of a 3D ball being tossed across the screen using the Throw behavior. Click on the disclosure triangle for the group to reveal its content. You can see the behavior along with the filters used to colorize the object. Let's add a little gravity to the ball so that it falls down.
Go to the gear icon just under the Canvas and choose Gravity from under Simulations. The Throw behavior is affected by gravity and the ball now falls down.
Press the F7 key to reveal the HUD. Increase the Acceleration to a value of 100. Notice how the ball falls down quicker as shown in the following screenshot:
Press the D key a few times to cycle to the Throw behavior in the HUD and drag the arrow to the right...