Wireframe 2019

(nextflipdebug5) #1

36 / wfmag.cc


Creating a jetpack in Unreal Engine 4

Toolbox


zero, let’s reduce the fuel count. We’ll also go
back to the currentFuel variable node and drag
from the right pin and connect these to the
corresponding pins on the IncrementFloat and
DecrementFloat nodes.
Now to work with our maxFuel and FPS
variables. I’d place the maxFuel above the FPS
variable for ease of setting this next part up.
Before we start hooking them in, go back to
the Branch we created originally that attaches
to Then 0, left-drag from the True arrow, and
search for another Branch node – the reason
being that we want to wire in the condition
we create from this next stage. We now move
to the maxFuel node and drag out from the
yellow pin and search for ‘multiplication’ (or *
symbol) and select float * float. You should now
see the maxFuel variable attached to the top of
this multiplication. We then drag the yellow pin
from the FPS variable to the bottom pin of the

multiplication node. Now drag from the return
value pin on the multiplication node, and search
for ‘division’ (or the / symbol), and select float /
float as our node.
We should have the multiplication node
attached to the top of the division node, and
also see a value of 1.0 in the type-in box for the
bottom value. We want to override this value
to be 60.0. Now move back to the currentFuel
variable and again drag from the yellow return
value pin and search for ‘less than’ (or the <
symbol), and select the float <= float node. You’ll
see that the currentFuel is linked to the top of
the less than or equal to node. Now we attach
the return value pin of our division node to the
bottom pin of the less than or equal node. Next,
plug in the return value pin for the less than
or equal to node into the Branch we created
last, and the Branch that connects to our
IncrementFloat node.

TO INFINITY AND BEYOND
Our last task is to apply a force to the player
character. Luckily, we have a premade function,
but again, we’ll make sure the frame rate is still
considered in these next steps.
First, let’s have a bit of a clean-up: I like to tidy
up all the nodes previously made, and make
sure there’s plenty of space to work in. Next,
select the FPS variable from the My Blueprint
panel and pull it into the Event Graph view a
second time. We will also create another new
variable, so again, select the applicable + button
next to the Variable heading and then move
to the Details panel. Set the Variable Name to
velocity, keep the Variable type as float, and
check the Instance Editable option. Now compile
this and set our default value to 26.0. Once we
have that variable, drag it into the Event Graph

TIDYING UP


If the wires are becoming
messy between nodes, you can
double-click on the wires to
create a reroute node. This has
no effect on your logic, but you
can use it to organise the flow
of the wires to their destination.


 We’ve set up the fuel usage
logic, so all we need to do is
make sure that we add our
force to the character.


 Once we’re finished, we should
be able to tap SPACE to hover,
or hold the button to boost up
to the maximum height.
Free download pdf