16 Game Development and Simulation with Unreal Technology
FIGURE 1.12: The Components of HeroTPP Blueprint.
VT The camera is also attac hed to a co mponent called a Spring Arm. If you
click on Cam era B oom in the Components pane on the left side, you will see
the details, as well as a red line that shows you the boom itself. The job of the
Camera Boom (spring arm component) is to keep the camera at the maximu m
distance possible according to parame te rs given. If the camera runs into a wall o r
another physics object, the boom becomes smaller until it is no longer o bstructed.
In the de ta ils pane under the Camera tab, you see a variable called Target
Arm Length. This is the farthest length that we want the camera to be from
the character. To further explain how this works, minimize the MyCharacter
blueprint and click Play in the main editor window. When you move the mouse
around, the camera moves aro und the character at a con stant distance of 300
units. However, if you use WASD to walk toward a wall or a structure and then
try to move the camera ar ound, the ca mera will move in toward the character
as it is blocked by the wall, to prevent the camera from clipping through the
wall or structure. This functionality is a very important part of the third person
character and one of the m ain differences between this template and the first
person template.
The other noticeable difference is in how the camera rotation happens. Instead
of rotating the camera directly, what we want to do is rotate the camera around
the character so tha t the char acter is always in frame. This is done with a simple