Setting up Unreal Project Templates 13
FIGURE 1.9: Input Axis and Act ion Mappings.
bring up all the settings available to us for our particular project. Under Engine
on the left side, find the Input section and click on it. This brings up all of our
default input m apping.
As you can see, Pressing W, or the UP arrow will inc rease our movement
in positive direction. Pressing S or the DOWN arrow return s a negative value
to move us in the negative direction relative to our camera. By calling it
MoveForward, we insure we have a node with this name that we can access
in the blueprint. You can go thr ough the other s to better understand where the
input mapping comes from.
If you click on the Components tab, you will see the parts that make up the
character. Th is character is mad e up of a camera, wh ic h the player is looking
through in-game ; a capsule, which is used for the collision; as well as some blue
arms, hands, and a gun. The arms, hands and gu n are actually part of another as-
set called a skeletal me sh. This is a UE4 asset that contains skeleton components,
meshes, and animations for those meshes. Th is asset is located in the Charac te r
folder and is named Her oFPP.
You can view this asset but d o not worry about complete ly under standing it
14 Game Development and Simulation with Unreal Technology
for now.
1.5 THIRD PERSON
A third person camera re fers to the c amera style where you can fully see the character
you are controlling. This is often ca lled an Over-the-Shoulder Came ra as well. In the
next Tutorial we will create a project using the third person template.
TUTORIAL 1.3 Creating a Project Based on Third Person Blueprint
CREATE A TPS PROJECT
FIGURE 1.10: Creating a N ew Third Person Project Template.
To create a new project usin g the third person temp la te , you need to fol-
low the same steps from the previous section. Launch UE4 and click the New
Project tab at the top of the window. Click the Blueprint tab and locate the
Third Person icon.
If you want to include the starter content, make sure you leave the Include
Starter Content setting to migrate the assets into your project. A s before,
leave the other settings on their default values for now. Give it a name and click
Create Project (Figure 1.10).
Once the editor is launche d, you will see the example map that is included
with the third person blueprint. You should notice at this point that th e map is
Setting up Unreal Project Templates 15
FIGURE 1.11: (a) A View of the Project Based on TPS Template in UE4. (b) The MyChar-
acter Blueprint Network.
not the same as the first person map. There are no physics objects, just a small
structure for you to test out the default characte r provided with this template.
The character for the third person te mplate is called MyCharacter and can be
found by navigating the Content Browser to Blueprint s->MyCharacter.
The event graph contains similar events to the first p erson tem plate. The
movement and input need some extra vector calculations due to the shifted ori-
gin of the character. We will explain this later.
What Happened in TUTORIAL 1.3. . .
At th is point, we have successfully created a nd ran a project using the third per-
son template. Let us go through the MyCharacter blueprint to better und erstand
the functio nality of this template.
If you click on the Compone nts tab, you will see the physical components that
make up the MyCharacter blueprint (Figure 1.12).
The HeroTPP mesh is a bit more complex than the first person HeroFPP
mesh. This is due to the fact that we can see the entire character in the camera
frame, and it would not make sense to only see a couple of floating arms.
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
Setting up Unreal Project Templates 17
FIGURE 1.13: Creating a New Side Scroller Project Template.
setting in the Components section.
If you click on CameraBoom and scroll down to the Camera Settings sec-
tion, y ou will notice that Use Pawn Control Rota tion is selected . This means
that w e can rota te the pawn itself when the camera is rotated. This gives us more
control of the camera while playing our game. We can rotate the camera boom
without updating the characters position b y dragging the mouse around. This is
possible because CameraBoom is a child compon ent of th e CapsuleCompo-
nent. The Spring arm will rotate around the character so that we can keep the
character on the screen at all times.
1.6 SIDE SCROLLER
Next, we will talk about th e side scroller template. A side scroller camera moves
left and rig ht, and views th e main character fro m the side. You do not have a 3D
range of movement like yo u do with th e third-person camera, but you can make very
interesting platforming game s as well as action games with a side scrolling camera.
In this section we will create a project using the side scroller template.
TUTORIAL 1.4 Creating a Project Based on Side Scroller Blueprint
CREATE A SIDE S CRO LLER PROJECT
To use the side scroller te mplate, we first launch the eng ine and click the New
Project tab. Click the Blueprint tab and find th e Side Scroller template. Give
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.187