Graphics Reference
In-Depth Information
Figure 15-17 Adjusting the radius
Visualizing Physics
The Show Physics Visualization option in the Game drop-down menu (located in the User Preferences window
header) is one of the most important troubleshooting tools you have for working with BGE. Collision behavior
can be sensitive and require some finessing. Using the physics visualization tools will enable you to see where
the collision boundaries for each object actually are so that you can ensure that they match up with their corres-
ponding objects and interact properly with other physical objects in the environment.
Setting Up the Camera
If you press P while you are in Camera mode, or if you create a free-standing executable game using the game
engine, the game will be displayed from the point of view of the active camera in the scene. There are several
waystoensurethatthecamerastaysfocusedonyourcharacter.Thesimplestwayistosimplyparentthecamera
to the armature with the camera pointing at the armature. If you do this, the camera's motion will be controlled
directly by every movement of the armature. This is okay for some purposes, but the resulting camera move-
ment is very stiff and the effect can be unnatural. For some 3D games, it is good to have a camera that can
follow the character loosely and respond in a more natural way to the character's movement, generally staying
at a set distance but responding in a more flexible way to the character's movements than if it were parented.
This is what the Camera actuator is for.
The Camera actuator is a logic brick that can be set on a Camera object, as shown in Figure 15-18 . In this
example, I use an Always sensor so that the Camera actuator is always active. The Camera actuator itself has
a field for the name of the object the camera should be pointing toward, in this case Armature, and also fields
for the height it should try to maintain, the minimal distance from the object it should be allowed to come, and
the maximum distance from the object it should be allowed to get. Setting these values as shown in the figure
 
 
Search WWH ::




Custom Search