Wireframe 2019

(nextflipdebug5) #1
wfmag.cc \ 33

Creating a jetpack in Unreal Engine 4

Toolbox


WORKING WITH BLUEPRINTS
We’re going to build on the first-person
blueprint to create our Jetpack mechanic. First,
a quick tour of the interface: along the taskbar
are the standard options for saving and loading
maps, preferences we can set for the project,
and windows for specific tools in the editor. The
window to the top-left, called Modes, contains
various editing modes and objects that are
available within those modes. Currently, we have
Place mode selected,
which allows us to
place game objects into
our scene.
To the right of this
is our viewport; it also
has some large icons above it that have a few
different uses, including the option to preview
our game inside the viewport. To the right
of that is the World Outliner, and this is the
hierarchy of the objects we currently have in the
scene. Any details on a selected object appear
below in the details panel. Finally, the window on
the bottom left-hand side is the content browser
and shows all the content that is imported
and usable in our project, such as materials,
animations, and meshes.
Sticking with the content browser, we first
need to access the Content folder. If you can’t
see the folder, then select the icon to the
left-hand side of the word Filters. Expand the
Content folder by clicking the right arrow and
then navigating to FirstPersonBP > Blueprints,
and then double-click the icon named
FirstPersonCharacter, which is our blueprint
object. To make working on the blueprint easier,
select the window and drag it up to the main
window next to the FirstPersonExampleMap
tab. This makes the entire blueprint full screen
instead of a smaller, free-floating window.


Now we have the blueprint open, we should
be able to see the Event Graph: this is where
we can do most of the setup for our blueprint.
We’re going to look for the code that relates to
the character’s jump
input. This should be
commented in the
blueprint, so move
around the viewport
and look for the word
Jump. We essentially want to remove the jump
and replace it with our Jetpack mechanic. So,
we need to delete the two function nodes,
which are the blue nodes named Jump and
Stop Jumping.
We will create our own boolean, or true and
false value, to evaluate whether we’re using
the jetpack or not. To add the new variable,
move over to the left-hand side of the blueprint
interface. Look for the panel called My Blueprint


  • this should have an entry called Variables. Click
    the + button to add a new variable. Now look at
    the Details panel on the right-hand side of the


“By moving to UE4,
we can look at another
way of scripting logic”

 All together now:
“Fly, my pretty... Fly!”

 Each frame, we need to know the current
frame rate, and if we have our key for the
jetpack activated. The following layout in
the Event Graph will achieve this.

EVENT
GRAPHS
You can navigate the Event
Graph by holding the right
mouse button to drag around
the viewport and using the
scroll wheel to zoom in and
out. You can also select
multiple nodes by dragging
across them with the left
mouse button. To add our
own comments, you can
select multiple nodes and
then press the C key on
the keyboard. Feel free to
comment the elements of the
Jetpack code as you follow
the tutorial.
Free download pdf