Motion's simulation behaviors allow for many kinds of interaction between objects. With a simple drag-and-drop, you can create entire orbital systems affected by wind, gravity and drag, all without a single keyframe. What it doesn't allow for, unfortunately, is collision between objects.
But there's a way to fake it.
Please note that the movies in this tutorial require Quicktime 7 to view.
Let's start with a simple example, and then we'll lead up to something a bit more fun. We'll begin by creating two circle shapes: one to hit, and one to be hit.
We'll put a Throw behavior on the red shape to make it fly at the white shape.
If you press play, you should see the red shape go flying through the white one. It's time to fake our collision. How do we do it? With the Repel From behavior.
While we can't actually make the shapes rigidly collide with each other, we can set the Repel From behavior so that the white shape will be strongly pushed away when the red shape comes to touch it.
With that simple step of drag-and-drop, we've told the white shape to be repelled by the red shape. Let's play back our project and see what we've got.
With the default settings, our results don't look too good. The red shape starts repelling the white one from too far away. We need to set the behavior so that the white shape isn't repelled until the red one is just about to touch it. Keep in mind that the numbers used here will vary, depending on the size of the shapes and the speed they're traveling.
Let's check that playback again:
Better. The white shape doesn't move until the red shape reaches it, but the red shape should stop moving (or change direction) as it transfers kinetic energy to the white one. The easiest way to do this is by adjusting the outpoint of the Throw behavior.
And once again, we check our playback:
That looks pretty good, but if we were going after a realistic look, though, we'd want to have the red shape continue onwards just a little, and maybe add some drag to both shapes so that they coast to a stop. For extra credit, try doing this:
HINT: Try adding a Repel From to the red shape.It's been fun knocking a couple of shapes together, but let's get to the cool stuff!