Game Development Reference
In-Depth Information
1.2 Relations between game objects
You might have noticed during your work in the last section that each game object can
be handled independently without affecting the other objects. You might need, however, to
move these objects as whole to another place, or make several copies of them. In either
case, you need first to select all objects together.
A better approach will be to handle all related scene elements as one unit by adding logical
relations between them. In most 3D programs and game engines, objects can be connected
together using child/parent relations. In such relations, changes applied to the parent object
affect its children but not vice-versa. However, children can override the values resulted from
changes to parent.
In Illustration 1, we can identify different building blocks that construct the scene: the ground,
the two arcs, and the three boxes. Supposing that the ground is the root of the scene (so that
all objects move together if we move the ground), it is reasonable to make it the parent of all
other objects in the scene, excluding the main camera.