It’s easy to animate an object moving from point A to point B. But what if point B was moving? What if both points were moving? This is a slightly harder thing to accomplish. Let’s start with a simple A – B movement and work up from there. I’ve kept the scene very simple and colourless to ensure a small GIF size.
Great. The canon ball has two key frames. The first keyframe is at zero seconds, with the canon ball inside the canon. The second keyframe is off screen, just past the cube, at five seconds. AOI calculates all the frames in between the two keyframes. I added the shatter effect manually to make the animation more interesting.
By default, objects have two animation tracks: position and rotation. The animation above simply has two keyframes in the position track. Since the projectile is a sphere, we wouldn’t perceive any rotation, so we don’t care about the rotation track in this scene.
Suppose you were animating an anti-aircraft missile. The missile’s origin would be stationary, but the destination would be moving. To accomplish this, we need to add another position track. Each track also has a “Weight” track associated with it. This new weight track defines how strongly it’s position is applied to the object. By default, weight is set to 1. This means that the position track is in full effect and the object will follow this position track perfectly. Setting the weight to zero causes the canon ball to not move at all. A weight of zero effectively turns the track off. However, when we set the weight to a number that’s in between 0 and 1, things start to get interesting.
Here we have one track active:
Now I have turned that track off and I have activated a different track:
When multiple position tracks are set to 1, the track that was added last takes priority. In this case, even though the original track’s weight is still 1, the new track is taking priority. So, if we turn the second track’s weight to zero we will see the canon ball move as it did before. BUT, what if we set this new track’s weight to 0.5?
Essentially, both tracks are influencing the ball equally. One track sends the ball north, the other sends it west. The result is a ball moving to the north west. To make things more interesting, we can animate a track’s weight. What would happen if we had the second track start at 0 weight and slowly transition that number to 1?
That’s really neat. Since track 2 starts off with a weight of 0, the ball starts in the canon as track 1 has told it to. In the end we see the ball exactly where track 2 has told it to be. As time passes, the ball is more and more influenced by track 2. This is a neat effect, but the final resting place of the ball is still a stationary target. In order to make the ball hit a moving target, we need to tell the ball to stop moving. I know that sounds weird, but bare with me.
It’s possible to set a position track to be relative to an object. This means that the track will use the center of an object as it’s origin, 0,0,0 (x,y,z). So, if we set track 2 to be relative to the cube and tell the ball to stay at the origin, it will not move. The ball would sit inside the cube. If the cube moved, the ball would move with it. The ball thinks it is sitting at 0,0,0. However, this is only relative to the cube. So the ball would end up moving with the cube, but the ball would think it’s standing still. Essentially, this track is telling the ball to be exactly where the cube is.
I have made the cube move from side to side. This animation starts off with the ball in the canon (track 1) and ends up inside the cube (track 2):
The ball follows the cube very smoothly. I had to tweak the weight animation to get this right. The bizarre thing is, if we wanted the cannon to also be moving, both position track would be telling the ball not to move. Track 1 tells the ball to stay exactly where the cannon is. Track 2 tells the ball to stay exactly where the cube is. No other work would need to be done. This is a self-animating object. I have often imagined using this animation technique to control the camera. Imagine a camera that automatically flies around your scene, focusing on the important object! But that will be for another day.