Attracting the Particles to Another Object


The school of fish looks pretty good. All you need to do now is give them something to do. When I first introduced you to Poly the animated fish, I mentioned that she was a toy fish that was brought to life by a magical AquaBall. Well, apparently, there were a lot of toy fish, and they're all searching for the magical AquaBall. Okay, so I made up the storyjust go with it for this exercise. Look at it this way: Wouldn't it be cool if you could get your school of particle fish to chase an AquaBall across the frame?

To save time, I've already applied a moving AquaBall to the project; all you need to do is turn on the AquaBall object on the Layers tab and then apply an Attracted To behavior to the particles.

Let's try it. First let's move the school of fish to the lower-right corner of the frame so they will have plenty of room to chase the AquaBall.

1.

In the Canvas, drag the particle emitter to the lower-right corner of the frame.

2.

Press Cmd-4 to open the Layers tab.

3.

On the Layers tab, click the Activation check box for the AquaBall object to turn it on.

4.

Press the spacebar to play the project, if it is not already playing.

An AquaBall moves across the screen, and the fish ignore it.

5.

On the Layers tab, select the fish_animation90 particle cell.

6.

On the toolbar, open the Add Behavior pop-up menu and select Simulations > Attracted To.

The Attracted To behavior is applied to the particle cell (individual particles), and the Behaviors tab becomes active in the Inspector.

Now you need to assign an object for the fish to be attracted to: the AquaBall. Notice the Attracted To behavior parameters on the Behaviors tab in the Inspector?

7.

Drag the AquaBall 1 object from the Layers tab to the Attracted To behavior on the Behaviors tab of the Inspector, and drop it in the Object well.

8.

On the Layers tab, select the Emitter object. Then press Cmd-3 to open the Inspector, if it's not already open.

9.

Experiment with the various Attracted To parameters on the Behaviors tab of the Inspector to create an interesting attraction between the fish and the AquaBall.

I used the settings shown in the following figure for my final project.

Feel free to use your own settings, or try mine to see what it looks like.

10.

Press Cmd-S to save your progress.



    Apple Pro Training Series Getting Started with Motion
    Apple Pro Training Series: Getting Started With Motion
    ISBN: 0321305337
    EAN: 2147483647
    Year: 2005
    Pages: 283
    Authors: Mary Plummer

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net