wfmag.cc \ 37
Creating a jetpack in Unreal Engine 4
Toolbox
to the right of the FPS variable we added, and
pick Get Velocity.
Moving back the last Branch node we
created, let’s drag out from the True arrow and
search for a Launch Character node. We’ll tell
the node about our character, so select the
value Target pin and left-drag out, search for the
Get Player Character node, and place it. Now
right-click on the node on the words Launch
Velocity and select Split Struct Pin as this will
allow us to set a force in one direction only. We
now select an open space on the Event Graph
and search for another division node – again,
this will appear as float / float in the search.
For the top type-in value on the division node,
change this from 0.0 to 1.0 and then plug in the
most recently created FPS variable to the bottom
pin of this node.
Now left-drag from the return value pin of the
division node and search for a multiplication
node, which should show as float float. We
should have linked the division node to the top
pin, and we want to type in the value of 60.0
to replace the value of 0.0. Select the velocity
variable, left-drag out from the return value, and
search for another multiplication node – again,
pick float float as our option. Finally, plug in
the return value from the other multiplication
node into the one we just created, so into the
bottom pin below the velocity variable. With
all that done, drag out from the return value
on this same multiplication node and plug this
into the Launch Velocity Z pin of the Launch
Character node.
We’re now ready to run a final compile on
the blueprint. We can then select the tab called
FirstPersonExampleMap, which is our level,
and preview our final mechanic by pressing the
SPACE key. All we need to do then is select the
Play icon from the viewport Toolbar. We can
use up all our jetpack fuel to gain maximum
height, or if we tap SPACE, we can hover for
a longer distance. There’s obviously room for
improvement, as we could add a particle effect
to the jetpack, or some HUD elements to show
fuel usage – really, the sky’s the limit.
FREE STUFF
Epic has several free asset
packs that include elements
from such games as Paragon
and Infinity Blade. The studio’s
also made several deals with
content creators to give away
marketplace content every
month. This is extremely
useful when prototyping your
own creations, and can be
found in the Marketplace
under Free content.
“We could add a particle effect
to the jetpack, or some HUD
elements to show fuel usage”
Jetpacks have a huge impact
on mechanical – and
fun-related – aspects.
The completed logic
for our jetpack is now
in place: we’re finally
ready to ascend.