Game Development Reference
In-Depth Information
saw objects will also play their respective timelines. This allows you to preview and fine-
tune animations, even if some animations were edited in other CCB files.
For instance, imagine you wanted two gear objects to interlock their teeth while rotating,
with one rotating clockwise while the other rotates counter-clockwise. To do so, you
would have to change the Rotation property of one gear instance in the level to get the
gear teeth to interlock. The Rotation property of the Sub File node will define the start-
ing point (or offset) for the animations of the referenced CCB file—much like a node's
position defines the initial starting point of a position (move) animation. You can then po-
sition the two gears and press the Timeline Play button to see whether they are interlock-
ing. If they are not, select the gear Sub File node again—each time you press Play, it will
deselect all previously selected nodes—and change the gear's Rotation property.
Repeat this until the gears interlock perfectly in motion.
At this point, you may be wondering the following: When editing a Timeline animation,
you previously could not edit the properties of the animated node unless the Timeline
Cursor was exactly on a specific keyframe. But now you can play and stop the animation,
and no matter where the Timeline Cursor is located, you can always edit the node's prop-
erties and they're always the same, too. How come?
To understand that, consider that you were editing the keyframes of a particular node in a
CCB file—for instance, Gear1.ccb . Here you tell the node what to do exactly during an
animation by adding keyframes for specific properties and editing property values for
each keyframe. For position, rotation, and scale animations specifically, these properties
have to be considered relative to the node's current state.
Then you placed an instance of Gear1.ccb in the Level1.ccb . That created a Sub
File node that references Gear1.ccb . This Sub File node represents a particular instance
of the Gear1.ccb . The Sub File node allows you to specify the referenced node's initial
position, rotation, and scale. During playback, the Timeline of the gear plays relative to
the Sub File node's position, rotation, and scale. Once again, this proves the utility of
working with multiple CCB files and Sub File nodes by allowing a greater variation of an-
imations simply by tweaking the starting values of the animation for individual Sub File
node instances.
With at least one gear or saw object placed in the level, you should publish and run the
Xcode project. If you notice an animation stopping after a single revolution, check that the
Timeline Chain is set to loop by setting it to Default Timeline.
Search WWH ::




Custom Search