Game Development Reference
scroll through the video clips at the same time. Check for details like the
orientation of the hands and the fingers; you may be surprised what you
discover from the video clips.
Setting up looping actions
When we created Charlie's walk we were careful to ensure that the
orientation for the beginning of the action was repeated at the end. In
order for actions to loop effectively, the end must be almost exactly like
the start but not quite the same. The easiest way to achieve a seamless
loop is to copy the key position at frame 1 of an action to the frame after
the last frame of an action. Then exclude this frame from the loop. By so
doing, interpolation from the next to last key to the last is effectively the
same as interpolating between the next to last key and the first, so the
Interpolating between actions
Since real-time character animation is generated at runtime, there are
often instances where one action must blend seamlessly into another. You
can do this in two ways. You could have a common position that all actions
can go back to and ensure that a switch between actions only ever occurs
when the character is in this position. In practice, this is hard to achieve.
It is very difficult to have a keyframe from a walk appear as part of a swim
and vice versa. If every action has start from standing and return to
standing link sequences then you are adding to the development time.
The easiest way is to create an interpolation between two key positions as
required at runtime. One way to achieve this is to store the current
position of the object and the destination position and interpolate between
Two simple functions that do just that are given below. SetTweenKeys
stores the start position and end position and is used by Tween as the
source and target positions for the interpolation.
//Used by Tween. It stores the current position, scale and ↵
//and a target position, scale and orientation.