Transcripts
1. Promo: In this course, we're
going to use a fighter jet from vigilante content
that is always free, and it is aaten. We will learn everything
about the bones, how we can change the wings, ailerons, and rudder rotation. So our fighter jet
looks more natural. We will learn how
we can take off, how we can close
up our gears and open up the girls as
well, how we can learn. And after that, we
learn how we can shoot any target
with a tag system. We learn lots about
UI in this course. So whenever you shoot a missile, it will show it you that
the missile is not there. You can't shoot anymore. After that, we learn
about enemies. So for doing that,
we have a radar and we have a missile
system that the radar will find the target and let the missile system
knows about the target, and the missile
system will shoot a missile at its target. If it didn't hit
the target, again, it will shoot the
next missile to it. That's it. Let's begin
this course together.
2. 01.Create and Import: This section, we're going to
create a fighter jet game. And for doing that, I'm using Argo engine version 5.5 0.2. Just click on launch.
In my opinion, just stick with this version. And when you learn everything, you can apply it to
other versions as well. Because Argo Engine
developers are changing the name of the
nodes always all the time. So if you are a beginner, you won't find that node easily. So it's better to stick with the same version as I'm
using in this course. So just click on launch. And when it open, just go
to games, and in here, click on the blank project because on a start from scratch, so you will understand everything from the
basic stuff as well. So choose the blank, and in here, don't check
the starter content. We don't need that, and we
want to do it in blueprint, leave all the setting the same. And you can change the location that you want
to create your project, and you can name your project
to whatever you want. I want to call it
FighterJet head, create and it will
create or project. Now that the project is open, there is a Z file
in the description of this video that you
should download it. It is called fighterjet dot ZP if you right click on
it and it extract, you can extract it or
you can just open it. And if you open it, you
can see it in here. There is a fighter
jet folder inside it, and there is assets folder inside that fighter
jet folder, right? We need to just copy this
Control C to copy it, go to Ao engine, go to content right click on the content folder and tell
it to show in explorer, and it will open up
the content folder of our fighter jet project
inside the Windows Explorer. In here, the only thing
that you need to do, you can just hit
Control V to paste all of those assets in
the content folder. Now, if you go back
to our real engine, you can see the fighter
jet folder is there and you can go inside and you can
see there are some meshes, there are some sounds,
textures, and visual effects. That's it. We are
going to use all of these assets to create
or fighter jet project. Just make sure that inside
the content folder, the structure is the same. Fighter jet, after that, the assets, it should
be exactly like that. If you copy this fighter jet inside the developer,
it won't work. If you create a new folder in here and put it there,
again, it won't work. You need to just paste it
in the content folder. And if you want to change
the location of that, you can do it in Areal
engine after that. Now with that done, I want to change some stuff
in Areal engine. First of all, go to Edit, go to Editor preferences. And in here, just
search for open. And the first option is called Asset Editor
open location. Change it from default
to main window. So whenever you open something, it will be open up here, not in another
screen or whatever. And after that, you
can just close it. After doing that, we
need to go to edit and enable a plugin
because for fighter jet, there is a plugin in
ARELEngine as well. It is called chaos vehicle. Just search for chaos and
go down until you reach the chaos vehicle
plugin and enable that, make sure you hit yes and
restart the URL engine. The restart is really important, so make sure you
restart the ARL engine. No, with ARL engine, restart it. We have the necessary plugin, and we have the necessary assets to create our fighter Jet game. Now, let's begin.
3. 02 Wheeled vehicle blueprint: Now, first and first,
we need to create the blueprint for
our fighter jet. So for doing that, go
to Content drawer, and in here in folder, right click, create
a new folder, and I want to call
it blueprints. So all of our blueprints
will be in this folder. I want everything
to be organized. So right click in here again, create a blueprint class, and in here, go to all classes. Search for wheeled vehicle Pawn. This wheeled vehicle pawn, we can use it to
create a fighter jet. There is lots of
things inside it. So choose that head select, and I want to call it PP because
our fighter jet is F 18. I want to call it F 18. That's it. Don't click on
it to open it and know like a character class that we
had a movement component. In this case, we have
vehicle movement component. And inside that, there is lots of things that we can change. We can add a trosser,
we can til it. What is the wings? What is the rodder and all
of that, right? After that, we can decide
a mesh, click on the mesh, and in a skeletal mesh asset
choose F 18 skeletal mesh. Choose it, and now you
can see it over here. First thing on this mesh
that we want to do, we want to go down and
simulate the physics because the game
that you want to create is a physics based game. You don't need to change
anything after that. What else we need? We need to create a camera, but we want to do it
with a spring arm. So in here, click on the mesh, click on add and in here, search for a spring arm. Add a spring arm.
You don't need to do anything for now, click on it. Click on at and add the camera, search for camera
and add it there. No, we have a camera. We can position it
with a spring arm so our camera don't go
through the walls. So click on spring arm in here. Let me go up. The target length. I want to put it
at 1,500. Like so. You can see because
our plane is too big. And I want to bring
up the position. I don't want to do it
with socket offset. I want to just bring up the
position like this position of our spring arm completely
because at default, it is at bottom of
our fighter jet pot, we want to put it at
the middle of it. That snow is better. Next thing that I want
to change in here, I want to change the use
pound control rotation. Make sure you do that. So whenever we change the yaw and pitch of our controller, the yaw and pitch spring arm will change with
the camera as well. So we can look around or airplane whenever we
need, and that's it. No, we have a fighter
jet blueprint. Right now, it can't move, but let's just spawn it in our level to see if
it's working or not. So for doing that, what I
want to do I want to create another blueprint this
time of type of game mode, and I want to call it BP
fighter jet game mode. Okay? Fighter jet, game mode. I'll click on it to open it. And here, the only
thing that we need to change is the
default pawn class. We want to change
it to BP Feighten. The blueprint that you
create together, that's it. You can just compile, save and close it. Now, if you go to
our level in here, I want to go into word setting and change
the game mode over right from the non to the
BP fighter jet game mode, the game mode that
we create together. Now, if you head save, it will tell you
to save this map. What I want to do, I want
to create a folder in here, and I want to call it levels. And in here, just head safe. So everything will be organized. Now, if you run over game, you can see over F 18. Right now, nothing is working. The physics is working. You can see it's moving, but it can't do nothing. So first thing
that I want to do, I don't want this fighter
jet to fall like this. I want to bring down this
players start like this. And after that head run, I don't want it to hit
the ground like this we want to calculate the
G force at some point, so it's necessary to put it on the ground exactly like this. Can bring it down
more like this. If we run. No, that's better. You can see it's
a stainless seal. No, it's time to first, to be able to look
around over fighter jet. Let's see how we
can do that next
4. 03 Look around fighter jet: Now let's see how we can move our camera around our plane. So player can look at different
angle of fighter jet. For doing that, we need
to use enhanced input. So go to content drawer, and in here in fighter jet, right click, create
a new folder, and in here, name it inputs. Okay? Go inside,
right click again, go to input and create
input mapping context. I want to call it IMC, fighter jet. That's it. And I will click
on it to open it. You can see how nicely it will open alongside over
blueprints and level. You don't need this plugin, so you can just close it. Now, in here, we need to again, right click Go to input
creative input action, IA look around. Okay? D'll click on it to open
it in here with the most, we want to rotate our camera. So we need X and Y of our most. Click in here, change the value type to
access to D or VctorTD. With selecting that,
you can just close this off and in the input
mapping context, create a mapping in here. We want to map the
IA look around. So choose it there after
that expanded and in here, go and click on the selection, go to Ms and choose Ms
X Y to the axis, right? So what it will do, it will
pass XY axis of or Ms, right? So now, you can save it, go to our blueprint,
go to event graph. In the event begin play, we want to get the
player controller, get the player controller. And with that, we want to get the enhanced input component. That's it. With this, we want to add or input
mapping context to it. So search for add
Mapping context. Add mapping context, right, and connect it like this
to event begin play, we want it to happen just once. So the mapping context is the IMC fighter jet that we create together,
and that's it. Now, if you go here and right
click and search for IA, L around, there is a event
for us there, right? We can use print test ring
to show the value like this. And if you run over game, you can see with changing
the position of the most, it will give us a
value 0-2, right? You can see no. Let's just delete this. For looking left and right, I want to use the X value
of this action value, and for looking up and down, I want to use the Y value of it. So drag and drop and
break the vector two this so you have access to
X and Y separately, right? No there is a node for
looking left and right, and the node is add
controller Ya input. Ya rotation around
the Z axis, right? So with that, we can just
pass the X to there. And if you have compile
and run, no, you can see, I can look left and right.
That's how easy it is. And we can use the Y for
controlling the pitch. Rotation around
the Y axis, right? So dry and drop at controller. Pitch input. That's it. We can just connect
the Y to there. Now if we compile and run, we can look up and
down like this. But right now, the problem
is that when the most go up, the camera is going up as well. I don't want it like that. If you want it to be
inverted like this, you can just leave it there. But what I want to do, I want to negate the Y, and
how we can do that, we can go to IMC fighter
Jet and in here, add a modifier with
type of negate, right? We want to negate just the Y, not X, not Z. Just the Y. So uncheck the
X and Z, leave it with Y. So it will multiply
it by minus one, and it will negate it. So now if you run over game, you can see, we can look
around or fighter jet. No everything is good. We need to move or plane. Let's see how we can
do that next video.
5. 04 Wheel setup: Our fighter jet to
be able to move, we need to set some stuff in the vehicle
movement component. So let's see what are those. First thing first, if
you go to Viewport, you can see we have three wheel, two of them at back in here and one of them at
front like this. And we need to tell the vehicle movement component
where are the wheels? What is the name of
their bones, right? I wheel setup. We have three wheel, so we need to define
three wheel in here. So create three element
inside this wheel setup. And if you go inside, first of all, we
need a wheel class. There are one already in here, but I don't want to use that. I want to just create
a wheel component. So for doing that, what
I want to do I want to go to fighter jet
folder, go to Blueprint, right click in here and
create a blueprint class of type of chaos vehicle wheel. If you go down, you can
see chaos, vehicle wheel. Just select that and
create it there. I want to call it
BP Feighteen wheel. Okay? I'll click
on it to open it. Inside this chaos
vehicle wheel blueprint, we will just set up some stuff. For example, the wheel radius. I want to put it at 40
and the wheel width, I want to put it on 30. You can get all of
these inside blender, for example, there, all
of these measurements. But if you don't
know how to work with blender and sizes there, you can just put
some values in here. And change it until you reach
the result that you want. Next thing, I want
to be able to use hand brake on this
fighter jet as well, and I want to have ABS enabled. This is for breaking. Whenever we hit a space, we want the wheel to lock
so it won't rotate anymore. So this is our wheel class. Now, we should go back to our
blueprint, F 18 blueprint, and in here instead of this
wheel class that by default, it is in here, we want to choose the blueprint
that we create together. So put it here. For
the next one, again, you can just click in here
and it will put it there until you are selecting it
in content drawer, right? And after that, go to Index two and put it
over here as well. Now, we need to specify
the bone names. So for doing that, we need to go and open up the
skeleton over fighter jet. So in here in fighter jet
folder assets meshes, Feighteen in here,
we have a skeleton. You can see it over here. At the bottom of it,
it says a skeleton, Dull click on it to open it. And in here, just
search for Wheel. And you can see there
is three of them. If you click on them,
you can go to them. If you head F, you can focus on them and you can rotate them. You can see this is over wheel and we need
to copy the names, copy bone name and put
it one by one in here. Let's just go to the next one, again right click Copy Bone
name and put it over here. Again, the next one, this one, copy bones name, and
put it over here. Cool. No, this vehicle
movement component knows where are the wheels so it can rely on them
and move them. And that's it for defining the wheels for our vehicle
movement component. Next, we want to
define the thruster, the engine, and the
wings and all of that. Let's see how we
can do that. Next
6. 05 Aerofoil setup: Know for defining the wings, the rudder and elevator. Let's first see what they are. For example, just search
for fighter jet Rudder. And if I click in here, you can see the
rudder is this one, and these ones are the
elevators, and what else? We have the wings as well. If I click on here, of course, you know what is the wing. No, we should define
all of those for Ale engine for vehicle
movement component. And for doing that, we
should go down until you reach the aerofoil setup. In here, we want to tell
it that it has elevator, it has a wing, it
has a rodder, right? So just click in
here to add one. First one, I want to add
the wings, okay? The wing. And the bone name, I want to use the fuselage of a whole plane as a wing
because in the Aerial engine, this body should be calculated in the physics
calculation, right? We can't just say this
is the wing, the wing. What we do wing create lift. So all of these, all of the body can
produce lift or drag. For defining the
whole body as a wing, I want to close this search and in here, let
me collapse this. I want to use this
one, cog joint, the joint, that is
the root in here. Right click on it,
copy bone name and paste it over
here for our wing. Next, for offset, I don't
want to change it at all. I want it to be the whole body, so the cog joint
is the whole body. Op axis is not minus
one, it is one. After that, the area
how many meter. If you hover over it,
it will tell you area of aerofoil surface,
meter squared. Again, you can go to blender
to measure it precisely, but sometimes you need
to change some stuff in here to make your
game more playable. Sometimes if you just put
the precise value there, it will be too hard
for player to control. For the area, I want
to put 15 in here. And if you again hover over it, it will tell you larger value, create more lift,
but also more drag. So lift. It can take
off much faster, right? The other options,
I don't want to change them at all.
Those are good. You can just hover over them. It will tell you what they do, but I want to leave it as it is. Now, for the next one, just click in here
again and in index one, I want to add the oder. So in here, just
choose the oder. And again, for the bone name, I want to use the whole body. So let's just put it over here. Again, p axis is
one, not minus one. The area 1 meter
is more than good. And for the other
options in here, you know that this is a Rudder. Let me again go and
show it to you. This is the Roder. Let me click in here so we
can see it better. Roder. 1 meter for the
area is more than enough. So let's just put one in here. It is one by default. The camber let's just how
over it, Cambra wing. Leave at zero if a rodder. So because this is a rodder, we should put zero in here. And the important thing in here, the angle in degrees through which the control surface moves. Leave at zero if it
is fixed surface. It is not a fixed surface. It can move, and
we will move but we should tell it how many
in degree it can move. I want to put it on
90 degree four, no, but you can limit it
more to 60, for example. But 90 is more than enough. It can move more than 90
sometimes in some planes, right? Next thing that I want
to add is the elevator. So let's just add
another one in here. We want to change
this to elevator. And again, for the
bone name, again, I want to use the
entire body in here. And again, these op
axis, we need to fix it. So no for the options in here. Let's just go here,
again, look at it. This is the elevator. You can see it elevator in here. So let's just based on that, I want to change the area, for example, to tree. Of course, you should
play with that. More area create more lift, but it will introduce
more drag, right? For the camber, I
want to increase this value a little
bit in future, we will change it much more, but these are the value that I did tested a lot and
these values are good. For the Max control
angle, again, I want to put 19 there, but based on your plane, you need to change that
as well, and that's it. No or vehicle
movement components knows about all of
aerofoils, right? So next thing, there is
some more setup to do. We will do it in next video. I want all of this video
to be like a cookbook. So in future, if you want to
check something out again, you can find the video easily.
7. 06 Thruster setup: Next thing that we want to
set up is the thruster. Right now, Arial engine
knows about the wheels. I knows about wing,
rudder, and elevator, but doesn't know
about the motor, the engine, the thruster, right? So go down. We have a thruster setup. Click in here to add a thruster, and in here, we can
have some options. First thing first, the
trustor type is fixed. It means it's not moving
in any direction. So just leave it at fixed. Next, the bone name, again, I can just use the
whole body there because we want to add
trust to the whole body. Don't think of it as
a actual airplane. Next, offset, I don't
want to change it. The trustor axis, it should be toward the X
direction. You know that? The forward vector
is the X direction. So the trust this motor engine should trust along the
positive direction. So Trust axis is more than okay, but I want to change the
Max Trust force to 35,000. That's it. That was
where Trustor setup.
8. 07 Arcade controll setup: Next setting that you want to change is the arcade setting. Arcade control or arcade
setting help player to control the airplane much easier because real
world fighter jet, it's not easy to control. So that's why we
have arcade control. So no, let's just go
to arcade control. In torque control,
I want to enable it because it will make
everything easier for player. I want to change the Ya
Torque scaling to 0.1. This is the one that we had E and airplane can go
this way, right? I want to increase the
pitch turkey scale into one and roll scale
into one as well. And I want to increase the rotation damping
to one as well. So when the player
want to rotate, it won't rotate really hard. It looks much better when we
have some rotation damping, some damping and rotation. So it won't allow the fighter jet to
rotate really fast. Next one is target
rotation control. The only thing that I
want to change in here, I want to enable it first, and I want to say roll
as a speed enable so the speed can
affect the roll. And next thing, want to change the rotation stiffness to
two, for example, right? These are some values that I test these fighter jets with, and it looks good. But in my opinion, you should change lots
of this stuff and see the effects in the game and reach the result
that you want. Maybe you want your
airplane or fighter. To be more easy to handle, or maybe you want it to be exact simulation that is
hard to handle, right? And that was it for setup
in the arcade control.
9. 08 Vehicle setup: Next setup that you want
to do is vehicle setup. If you go to vehicle
setup category, you don't need to
change much in here. If you want to change the mass, you can, for example, right now, with this mass and that trust
value that we put in there, it can move the plane
and bring it in the air. But if you increase the mass, that trust value that we put, it won't be able
to move it at all. So this mass is
really important. By default, it is good. Next thing, we need to enable center of mass to be overrided, and with that, you don't
need to change anything in here with enabling
center of mass override. It helps us to put the center of mass at
the middle of our plane, and that's how it should be. Sometimes you need to change these values until you reach the result you
want, of course. And that was vehicle setup.
10. 09 Set thrust: So finally the
setups are finished. But sometime in future, we will change some
stuff there to show you some other settings because
just talking about them, you will forget it really fast. But if we change something and see the
effect in the game, you will understand it better. For example, if we change
the mass, what will happen? If we change the trust, what will happen, right? So now with that, let's just test if we can move or plane. So for doing that, I
want to add a trottle. Let me search what
is the throttle. I don't want you to
know all of this stuff. That's why I'm searching
for everything. So you know more
about the planes, and then you will learn
how to create it, right? So clicking here, you can see, we have a joystick in
here that with that, we control where the
fighters yet go, but we have a
throttle in here that if the player push it forward to the end it will give the max
trust at the engine, right? But if you put it
all the way to back, it means the engine is almost
dead or shut off, right? So the throttle value
is a value 0-1. So for doing that, we want to control it
with shift and control. With shift, we can increase the throttle and with control, we can decrease the throttle. For us to change the trotle, I want to go to Compton drawer in the fighter jet
folder in the input. And here, right click, go to input and create input action. I want to create
two input action, one for increasing the throttle, that we call it trust, and one for decreasing the throttle that
we call it break. So we say I trust. And we need another one
input action, IA break. Okay? So this IA
trust will increase the throttle and the IABak
will decrease the throttle. This way is much easier to understand it and
to work with it. Now with that done,
we should go to IMC for input mapping
context and map them. We have one for IA
trust, so IA trust. And in here, whenever
we head shift, we want to trust, right? Don't need to change anything. Next, we want to map
the IA. Let me see. I break. And in here, whenever we had control, left control on our keyboard, we want to decrease the
throttle. We want to break. Now with that done, I want
to go to content drawer and tell them to pass a float value. So put it to float
for both of them. I break as well,
put it to float, so it will pass the float. So for example, if you left
shift on our keyboard, it will pass one. And
this is important. Let's just now go here
in our Blueprint, FAighteenR click in here, IA trust with IA Trust, no, it will give us a event
for increasing the trust, how we can increase the trust. In the vehicle
movement component, if we drag and drop
and put it over here, there is a node that is called set Trotle set throttle input. That's it. Now, we
can just put it over here and connect the
action value to throttle. We know that the action value
will give us a value 0-1. It won't be more
than that, right? But what will happen
with this the throttle, whenever we hit left shift on our keyboard will be it's max. So no run. And in here, if I
head shift once, you can see the
trottle is at maximum. And our plane is trying to
take off and it is taking off. So everything look good. We can't move it around, but everything is working fine. So in here, first
problem is that the trotle get to
the max really fast. We don't want that to happen, so we need to
smoothly change it. Let's see how we
can do that. Next.
11. 10 Interp to: So the problem that we
had in last video was that the trotle is
changing 0-1 really fast. Let's just see it one more time. If in here, just print some string and show
this action value here, run, and if we shift, you can see, all of a sudden it's one and it's not normal. So what we can do with that? There is a node that is
called F interp two, okay? This node help us
to smoothly change a value from a current
te to the target value, for example, 0-1, right? So no. For this node to works, we need a variable. And for that, I want to
create a variable in here, on a name it Trotle value. And the type of it, I want it to be float because the trotle is a float, right? So by default, it is zero. So the current is always zero. So put the throttle
value in current. The target, we want it to
be the action value, right? And it needed Delta time. We can get the Delta
time from the eventq, but other ways is to get it. Get word, Delta
second. That's it. That is exactly like
connecting these to this Delta second in here.
That's more than enough. We need to put some
speed in here. For example, 0.5, of course, you can play with this value. After that, we need to set the throttle value again with the new value that each
time this will give us. So for doing that, I will get the throttle value, set it over here
with this value. So let's just connect this to
here, connect this to here. Only use a printer ring
to show it to you. So in here, I want to use a printer string and
show the throttle value. The plane won't move
because I didn't connect the throttle value
to here. So let's just run. If I had shift, now you can see it is smoothly
start from zero, and after that, it
will reach value one. It will get close to it, right? So that is how in real
world, the throttle work. It won't happen really fast. It takes a little bit time. The time that it take, you can change it with
this interpo speed. You can change the speed of changing this
throttle value, right? I don't want this
printer ring anymore. I can just connect this to here and throttle value to here. Now, with that, let me
organize a little bit. If you run over game,
if I hold shift, you can see it slowly start
moving, and after that, it will reach the max
throttle that is one, and it's flowing as well. That's good, right? Now that we have
done the IA trust, we need to do the IA break. We need these nodes as well. We want them decrease this throttle value whenever
we hold left control. You try to do that. I know
this is a hard challenge, but try to do it yourself. We will do it in next video.
12. 10 Set brake: No f break. Let's just go here. We can say I break. Get the I break, the enhanced input action
that we create together. In here, whenever we
hit left Control, this I break will happen and what we want to happen
exactly all of this. Select everything, Control, see to copy it and
paste it over here. The difference is this time, we want to decrease it to zero. So in here, the current value
should be throttle value, that's okay because we are tracking the throttle
value always. We want to decrease or
increase it, so we track it. And the target this time, we don't want to connect this. We want to just leave it a zero, bring it to the zero. Again, for showing you that, I want to use a printer string. Test sring and show the throttle value
whenever we hit the brake. If you run over game, you can see if I hit
shift, it will move. And if I hit control, you can see it is decreasing it until it reached the zero, and the plane should stop. But of course, it won't
stop because it is sliding. There is not much
friction there. You can just bring
it to the zero, and eventually it will wait. So no, whenever we hit brake, it will get the throttle
value and it will smoothly decrease it to the zero until you
hold in the control. Everything is working
fine with the braking. So let's just connect this like this to here. So that's good. Next thing I want to
show you how you can use hand brake because you
saw the trust was zero, the throttle was zero, but the plane doesn't stop. We can use hand brake for that. Let's see how we
can do that. Next.
13. 11 Handbrake: For handbeak. I want to use
a space for hand breaking. So let's just go to content
drawer in here, right, click. Go to input Create Input Action, and I want to call
it IA hand break. Okay. I'll click
on it to open it. The digital boolean
is more than enough. We need to go to IMC as
well and map it there. So click on mapping, and we want to map
the IA hand break. And in here, whenever
we hit space, we want to hand break
to happen, right? That's it. Now, we can go to
our blueprint and in here, right click search for IA
hand break. And that's it. Again, there is a node in vehicle movement component
that is called set hand brake. So search for hand brake. You can see set
hand brake input. But this time, we want to check. If we pressed the pace, we want a hand break to happen. But let me control C
control with copy it. But whenever we release
the space or complete that is exactly released we want to disable
the handbrake. That's it. I need the
target as well in here. Now, with that, let's
see what will happen. If we run over game, if we hold shift a little
bit, it will move. And if we hold control,
it shouldn't move, but if we hit the space, you can see it is
stopping no. You see it. Again, it's moving because
it has some trust. If we hold control more
and hit the space, no, you can see it
is staying there. Everything looks good.
The handbrake no is working and a plane
is not moving at all.
14. 12 Wheel animation: Now we have some trust
on our fighter jet and we can move our
fighter jet fit it, right? But let's just look
at some problem. If you run over game, you can see, first of all, look at the wheels. If we go forward, you can
see wheels are not moving. Why it's not moving? We did enable the physics. We did set it up in vehicle
movement component, but it's not moving at all. It doesn't look
good at all, right? So for fixing need
animation blueprint, like we wanted or
character class. So if you click on or
mesh, as you know, this fighter jet is just a skeletal mesh that it can have animation blueprint. So for doing that, we should go to content drawer. I want to go to fighter
jet folder, and in here, I want to go to
Blueprint because animation Blueprint is just another type of
blueprint, right? So right clicking here, create a blueprint class, and in the classes,
search for vehicle. Animation, we call
animation instance. Just choose that head select. This is the chaos
animation blueprint that help us with the
wheeled skeletal mesh. I want to call it ABP
for animation Blueprint, F 18 because we
are using an F 18. Don't click on it to open it. I will tell you there is
no skeleton in there, so head in here and
choose a skeleton. We want to choose
over F 18, right? Head ok, and it will
put it there for us. Now that we have
animation blueprint, we can set it up in here, just by clicking on this arrow. Whenever you select something in the content drawer and use
that arrow beside anything, it will put it there if
it's possible, right? No, where ABP f 18 that we
create together is set there, but nothing will happen because we didn't do
anything in there. If you don't click on
it, it will be open. It's exactly like any
animation blueprint, but we can do lots of
things with vehicle. I will show most of them. First and first, in here, we should get the mesh f pose, mesh space, f pose. This will give us the location, rotation and everything skeletal
mesh of our fighter jet. And with that, there is
a node that is called wheel control for
wheeled vehicle. That's it. W just
connecting that there ph automatically converted from
component to local space. We had compile and
know if you run over game and head shift, no, you can see it's moving. You can see the wheel. No, you can see it's moving, and that looks beautiful. We can head the
space to hand brake, and you can see
how easy it was to add rotation to our physics
space wheels, right? One problem that
we have in here, you can see the front
wheel is at the sky. So let's see what
is the problem. For fixing that, we
need to go to BP F 18, click on vehicle
movement component where we set up the wheels, right, and we need to change
the radius of the front one. If you remember, we
have the BP F 18 wheel. If we change these to
35, for example, no, if we compile and
go here and run, you can see it's a
little bit down, but the back wheel is a
little bit in the ground. Again, if we change
this more, for example, to a ridiculous value, 25 and head compile and
run over game again, you can see, no, the front wheel is underground, but the back wheels
are into the ground, and you can see it's working, but the problem is it
doesn't look that good. So you need to find
a way to fix that. And the way it is,
you should have another wheel class
for the front wheel. You try to do that, and we
will do it in next video.
15. 13 Wheel radius: No, for fixing the wheels, the difference between
the radius of the wheels. For fixing that,
you know that the 25 in here is good
for front wheel, but for the back wheel, we need to use 35, for example, or 40, right? So we need another one
of these BP FAT wheels. So let's just find that first. If we go to fighter
jet folder blueprint, we can duplicate this wheel
by Control D to duplicate it. And this one, I want to call
it BPF ATN back wheel, okay? This is for front wheel, so let's just change it
to front front wheel. And let's just do click on it. The front wheel, we
want it to be 25, but the back wheel, we want it to be 40. The radius of it, we
want it to be 40. That's it. Let's
just hit compile. And now we should go to BPF 18, click on vehicle movement component and change them there. But which one is the front one? Which one is the back one? What I want to do I want
to go to a skeleton of this and search
for wheel to see which one we should select for the front and which one we should select for
back wheel, right? So clicking here.
You can see we have a wheel joint that
is the front wheel. So LF wheel joint
is the front wheel and the others are the back wheels. So
let's just go here. Left wheel joint is the front. So just leave that like this. But the other ones, we want to change
it to back wheel, this one and this one. Don't worry about these names. The name of the bones are
not that good in here, but we did check it out. And now you can see
the front wheel is okay on the ground and back wheel is on
the ground as well. Of course, you can
change some stuff. Let me put this over here. For the front, I want
to put 28 maybe, and for the back, let's
just change it to 35. I think that looks much better. Now, if you run over
game you can see, it's pitch perfect, right? It is on the ground and
everything looks good, and the wheels are
moving as well, and we can break as well. You can see how
good it's working. Let me move again,
and you can see I can use hand brake as well. Everything looks good.
Congratulations.
16. 14 Thrust VFX: No, our wheels are turning, but when we change the throttle, we don't see any effects. So what do you want to do? In here, when we
increase the throttle, we want to have some fire
out of the exhaust, right? Let's see how we can do that. For doing that, if you go to our skeleton in here, go down. We have some sockets that
is called LT engine. You can see in here. If I had
told you, you can see it. L T engine and RT engine. You can see it will
give us a position of where that our engine should
create some fire, right? So we can use these two socket to add some visual effects. For doing that, we can
just click on or mesh, click on AD and in here, search for Niagara
particle system. One for left engine. And we need another one with Control D. I did duplicate it. This one is for Wright engine. So put it on Wright
engine. That's it. Now with that, we can decide which visual effects
we can put in there. Select both of them
with holding Control. And in here in
Niagara system asset, just choose NS for Niagara
system engine Feighteen. Now you can see it in here. But it is not in the
right direction. Why? Because we need to set the socket there where
it should be, right? For the right engine, we
can go to parent socket, click in here and search
for right RT engine. Next, for the left engine, again, we should do the
same click in here. This is for left
engine, so LT engine. And right now, the problem
is that it is backward. For fixing that, we can
just select both of them and rotate them 180 degree. In Z direction, and that's it. You can see it.
Everything looks good. Now, if we head compile
save a Runo game, we have some visual effects that show if our plane
is moving or not. But right now it is at maximum. Why is at maximum. If you click on one of them, for example, the right one, you can see there
are user parameters. So if you put 0.1
on this direction, no, you can see it
is less than before. If you put 0.5 in there, no, you can see it. It is more. Now if you put one, you
can see it is at maximum. If you put two in here, again, it will be more. We can play with this value. Just with is, we don't
need to change Y at all because you can see if you change the Y, it
doesn't look good. We can put all of them at two. If you want this way, it doesn't look that bad, but I want to put
all of these to one, but change the X based
on the throttle value. At default, I want to put it
on zero for both of them, art engine, and left engine. So that's it. Now, we want to change them based on
the Trottle value. How we can do that, we
can go to event graph. And in here, I want
to use Eventq. But because we
want to do lots of things in eventq
what I want to do, I want to create a
function for that. So in the functions, click in
here to create a function. I want to call it manage
Trotle VFX. Okay? That's it. In this function that you
want to use it on eventq, we can just drag and drop it, put it over here, and
connect the execution pin of or event to manage
throttle via fax. Whatever we connect to here, it's exactly like connecting
it to eventq, right? It will happen 30 times per second or 60
times per second. No, we can get the
left engine and right engine in here and
set a parameter in it. As you know, if
you click in here, the parameter is called scale. So in here, we want
to say set prometer. And you can see there
is lots of them, but as you can see, the
scale is a vector tree. So we need to say
set vector prometer. Okay? Set vector prometer
for both of these engines. We don't need this instance because we did
create it over here. Now, the prometer
name is a scale, so we should put
it there, a scale. We want Y to be one, and Z, we want it to be one, but DX
we want it to be different. So what we can do, we
can break it over here, make a vector over here, for the Y, put one, for the Z, put one as well. But for the X, I want to
use throttle value, right? Now, let's see what will happen. If you run over game, you can see right
now it is at zero. If we hold shift, you can see it will increase, increase, and you can see it. It's too small. We can increase it by
multiplying it by something. If we hold control, you can see it will decrease, it will decrease,
and at the end, it will reach zero, right? No, for changing the
scale, right now, the throttle value, we know that it won't get
bigger than one, so we can multiply
it by some value. For example, multiply it by two. So the fire at the
engine will be bigger. Let's just it compile and
know if we hit shift, you can see the fire is
bigger and it does look good. If we hold control, it will decrease as well. Everything looks beautiful.
We can increase it, and we can decrease it as well. Ooh. No, we have
a visual effects for showing how much
trottle we put in there. Let's just go to file and
save everything for now.
17. 15 Engine sound: Well, no, when we
change the throttle, we have a visual effex, but it's not enough. I want to add more things to it. For example, the sound. Let's see how we can do that. For the sound, I want to
go to Content drawer, and in here in the fighter jet, I want to bright,
create a new folder, and I want to call
it sounds, okay? And in here, right click, go to audio and
create a metasund. I want to call it s jet engine. We have a song for that as well. I'll click on it to
open it and in here, you can see something
similar to blueprint. It's exactly like that, but with some differences. For example, in here, we have a wave player. With the wave player, we can play whatever
audio that you want. For example, if I
select the jet engine, we can play it by
clicking on play, okay? So know with that,
if you hit play, nothing will happen
because at the O foot, we should connect the Ot
Mono to Ot Mono in here. Now, if we had play, you can see explain the sound. But first and first, what I want to happen in here, I want it to be on loop. So if it reached the end of this audio, it will start over. That's one thing that we need. Next thing, I want to be
able to change the volume of this wave player based
on the throttle. So if the throttle is maximum, the sound I want it
to be higher, right? So for doing that, there is a node in here that
is called mixer, monomxer two, right, and it
can mix two sound together. But with the gain, we can change the volume. So for example, in here, I can promote it
to a graph input. I want to call it
gain or volume, whatever you want to call it. So now in here, if you click on this game that
we create together, we can change the range. For example, I
want it to be 0-2, for example, or be between
0.5 to two, right? Now if you play, you can see, I can decrease it to
0.5 and I can increase. With this game, I want to
change the pitch as well, so I can just connect
these to here as well. So whenever we change the game, the pitch will shift
with it as well. So if you run over metasund
again, you can see. You can see how good it looks. Or we can just multiply this, multiply a float by
two, for example, like this and connected
to the sheat again, a stop and start. Now, you can see the heat
is changing much more. Or we can just change
this value to four maybe, and know with that, again, if you run it, Okay. Try too much. We can just maybe. So just play with these values until you reach
the results that you want. This gain input that
we have in here, we can change it inside
blueprint as well. We have the Metason
this finished. Everything working
fine. We can go here. And like we did it for the
right engine and left engine, we can click on the mesh. This time, you
want to say audio. We want to play the audio. And the audio that we want to
play is audios jet engine, the metasun that you create because we selected over here, that's why it is smart
and knows what to pick. So it will create a audio component and it will set the MS
jet engine there. No, we can't play it. If you run it just like this, it can play it and we do
throttle it won't change at all. But in this managed throttle Vx, what I want to do I want to get this jet engine and set
a perimeter on there. Set a float perimeter,
right? That's it. If there is a yellow in here, it means it is not the
right one. So set a float. The second one is the right
one. So use this one. This should be blue and
connect these to here. We want to change the gain with what with this
throttle value, right? If I just connect these to here and compile and run over game, if I shift, you can see, No, it is changing
better, right? And if I decrease it, you can see the
audio is changing, but that's not enough. What we can do, we can
add some value to it. So at default, it
has 0.5 inside it. So add 0.5 to it and after that, change the gain variable. Change the gain input, right? Let's compile and run. You can see by
default it is 0.5 no, but if it holds it, you see the value is changing. And that I think is
good. You can play. Of course, you can
play with this value. You can increase it if you want. You can multiply it if you want. You can do all kinds of things. But in my opinion, right now, this is
more than enough. Again, let me show it to you. At default 0.5. It sounds good. If it hold chip, it will increase the volume, and it will increase
the pitch as well. Everything looks good. Cool. No, I want to show
you another thing. I want to add some UI. But see we can do that next
18. 16 Widget blueprint: We did show the
throttle value with the visual effects and
with the sound as well, but we want to show
it as a UI as well. In Ao engine, for creating a UI, there is a tools that is
called Widget Blueprint. Again, it's like any blueprint, but it's called
Widget Blueprint. That in there, we can create some UI very much easy drawer. And in here, I want to go
to fighter Widget folder, right click in here,
create a new folder, and I want to call it widgets. So all the widgets that we create for the
UI will be here. Dog click on it, open
it right click in here. And at the bottom, we
have user interface, and after that,
widget Blueprint. Click on that. The
type that we want to create is a user widget,
so click on that. I want to call it WBPF 18 UI. That's it. This is the
name that I choose. You can choose a better name. D click on it to open it. And now you can see in here
we have a view panel in here. We have a palette that you
can just drag and drop things into our view in here so we can
show it in our game. For example, if you want to show a image or if you want
to show a button, we can just drag and drop it and you will see it in a minute. But after all of this, we have a graph as well in here. In the graph, we have event
construct and eventiq. Event construct is
like event begin play, and this eventiq is
like any eventiq. It will happen 60 times
per second, right? No, let's just go
back to designer. Let's just test something. For doing one thing, there is millions way of doing
that one thing in Aongine, for example, in here, the way that I most of the time create my UI is with the panels. For example, Canvas panel. So we can just drag
and draw one in here, and this is our canvas panel. Canvas panel is or
monitor screen. You can think of it
like that, right? And inside this Canvas panel, it will give us lots of options. For example, let me go up and add a text inside it, right? And with this text
in detail panel, when we click on it, you can see I can change
it to whatever I want. For example, hello word, right? And in the font in appearances, I can increase the size. After that, there are
lots of option in here, for example, size to content. If you click on
that, you can see, no size of it is the size of the content
that is inside it, that is over text, right? I will talk about other
options as well, but for no, let's just talk about the
most important option inside a canvas panel. Because we add the Canvas
panel in hierarchy, you can see the canvas panel. And as a child of that, we have a text that
says hello word, right? But the good thing about the
Canvas panel is anchors. So with the anchors,
if you want to put it at the
middle of a screen, you can just click in here. Now you can see the anchor point is at the middle of a screen. So if you put zero and zero for position
X and position Y, it will put our
text at the middle, anchor it to top left
corner of our text, right? But what if if we want to anchor this middle point in here
to the anchor point? How we can do that, we can do
it with alignment. In here. We can say 0.5, this.in here is 0.54
X and Y to zero. If you want to put it exactly at the middle of the screen, we can put 0.5 for
alignment in Y direction. No, you can see the text is exactly at the middle
of our screen, right? No, we have a UI, right? Hello word UI. Let's see how
we can show it in our game. For doing that, we should
go to our blueprint. And in here at the
event we gain play, we should create it first, and after that, add it to our
screen or viewport, right? So for creating a widget, you can just search
for create widget, convenient, right?
Create widget. And the type of class
that we want to create is WP, FATNUI. And after that, we can
add it to viewport. That's it. Now, if
you run over game, you can see the
hello ward is there. That looks awesome. We
have a hello word there, but I don't want to
do it like this. I want to promote the featured
blueprint to a variable, so we can update the text there. So we say promote to a variable, and I want to call it FtenUI. Okay, Feighteen UI, I
need the execution pin. So let's just give it
like this. And that's it. Now we have access to
Feighteen UI Always. Let's see how we can.
Update the text there. It says, Hello word right now, but we want to change
it to something else. For changing it, first of all, click on it in the designer tab and make it is variable
to true, right? Because it should be a variable, so we have access
to it in the graph. You should name it
something good. For example, text, right now, the text is more than enough. Now, let's just go to graph. If you go to graph, no, you can see inside variables, we have a variable that the name of it is text, the
name that we choose. We can get it like this
and set the text on it. Just search for set text, and you can see it over here, and like this, I want
to call it F 18. So with that, if you
compile and run, it should say Feighteen. So you can see it. That looks really good, right? No, I don't want to
change the text in here. I want to change it
inside or blueprint. How we can do that, we can
create a function for that. For example, inside
this function, we can create and I want
to call it set my text. I don't want to use set text
because it's already there. I want to call it set my text. And inside this function, we get the text like this and we set a text in there,
right? Set text. And connect it like this. And this function can
have inputs, right? So for passing something from a one blueprint to
another blueprint, we can use functions inside
that second blueprint, right? And each function can
have input and output. And in this case, we need an input
of type of text. So click on the function itself, and in here in inputs,
click on input, and the type of it, as you know, it should be text, and I want to call it text or whatever. I want to call it my text. So you will
understand it better. No, with this input, we can just connect it to
over here, so we there. Now, let's see how we can use this function to set the
text inside or blueprint. In here, what I want to do in the handbraak whenever
we hit a space, we want to change the
text to handbeak and whenever we release
the space bar or release the handbeak, we want to say handbeak
release, right? For doing that, we get the
FATUI, get it like this, and we say set my text, the exact function that
we create together. And in here, I just
want to say hand break. Now, we can again, use the function, set my text. And in this case, we want to say
handbrake release, hand brake release. That's it. Let's just head compile
and run over game. No, you can see
if we hold shift, it will move, if
we hold control, it will stay a little bit. The speed is less. If we hold the space, no, it says handbrake. And if you release the space, it says handbrake release. And we can test it, right? So that's how you can work with the Widget blueprint.
We don't need this. We don't need this
function at all. So let's just delete
that, and that's it. It says, Hello word. I want to change
this to F 18 for no. So it show F 18. Whenever we run over
game like this, and I want to show
you how you can have some effects on this
text in next video.
19. 17 Widget animation: Now let's see how we can give these text a little
bit of animations. How we can do that,
we can do it with animations inside
digit Blueprint. Let's see. Just click on it and go to Animation
Stab in here. Click on animation, and it
will create a new animation. I want to call it text fade. Okay? And click on it again. No, the text fade animation is selected and you
can see it over here. Next, we should add
the text that we select in here to the
animation timeline. So click on the text and
you can see it over here. We can do a lot of
things with these text. If we click on this plus, we can change lots
of things in here. For example, color
and opacity, right? So by default, you
can see it is white. What I want to do after, for example, 1 second, we want to change the
Alpha or opacity to zero. So at time zero, we want to create a keyframe. So click in here to
create a keyframe. Sometimes when you
click in here, it's not creating a
keyframe, you can see it. You can change some value, so it will create a keyframe
for us and after that, go back in here and
create a keyframe there. We can delete this keyframe
that we have in here. After 1 second, we want to
change the Alpha to zero. So click in here,
put it to zero. Now, you can see we have
another keyframe at the end. So you can see at the start, the Feighteen opacity is full, and after 1 second,
it gets away. No, with that,
let's just compile, save, and go to grab. We should play this animation on event Construct or
wherever you want. I want to do it with
event construct. So we get the text fade
animation like this, and we say play
animation. That's it. Like this. There are a couple of options that you can change, but at default, it is okay. No, let's just
compile, run or game. You can see at first, it says FATen and after a
second, it will go away. But I want to make it better. So let's just go to designer. Again, go to animation, click on the animation. Now in here, I want
the text to stay for like 0.75 second in here, and after that, go away, right? So what I can do, I can
put the cursor at the 0.75 and create a keyframe
at this with Alpha of one. Now, you can see from
zero to 0.75 second, it has full opacity and
after that, it will go away. Now, let's just just look at it. Run. You can see
FATeen is there, and after that, it will go away. Next, what I want
to do I want to increase the time
that we have in here. So I can drag these two key frame that we
have in here and bring it, for example, after
three second, right? So know what will happen. The text will stay for 2.75 seconds and after
that, it will fade away. So let's just look at that. Now, if you run over game, you see if Aten is there, and after 2.75 second,
it will go away. And I think that looks good. No, it's time to go
to create a trottle U
20. 18 Throttle UI: Now let's see how
we can actually show the throttle as a UI. For doing that, I want
to use some newer tools. Just in here, we have a border. So drag and drop that
in our canvas panel, or you can just put it
over here. That's it. No, first thing first, I want to anchor it to bottom
right corner, but wherever you want
to put it, it's okay. Most of the game put it
on bottom right corner. I want to change the position
to zero and zero for now, on align it to the bottom right corner to
anchor to the anchor point. So for doing that,
we put one and one to the alignment. That's it. Now, I want to
position it a little bit away from these sides. So for that, I want to put -50 -50 like this. Next, the size. I want to change the size to
50 and the size Y to 215. Okay? Now, we have a bar, right? But the good thing about the
borders is that we can go to brush and change the brush
from the default one to image. Search for Trottle B. And now you can see, we have a throttle background.
Cool, right? It's a border, but
we use it as image. Next thing, let me
show you something. If I go to textures, you can see there is a throttle
texture in here as well. I want to use. For using that, because I want it to
be easy to work with, I want to go and create a Canvas panel as a
child of this border. In this Canvas panel, the only thing that I
want to do I want to zero all of the padding, so it won't have any
padding so we can fill up. Now in child of this, I want to use an image. So go to Image drag
and drop it into this Canvas panel
and click on it. Now, we can tell this image
to be the Trottle itself. So in here, we choose
the image to be Trotle and I want to
start from bottom. So that's why I'm using Canvas because I can anchor it
to bottom middle, right? And I can put the position
to zero and zero. And the alignment to be 0.5 0.5. That's it. That
looks good, right? Now, with that, with
the position Y, you can see, I can
move the throttle. You can see the maximum value should be here maybe is -200. When the throttle is at max, the position Y should be -200, but when the throttle is zero, it should be over here, right? The position Y should be zero. So in all of these, the only thing that
you want to change is the position Y of
this throttle image. We don't need to change
anything in background, right? So in here, we want to
make it a variable, and we want to call
it trotleimage. Okay? Now we have access
to it inside the graph. So for updating this throttle, I want to create a function, and I want to call it
set Trottle, okay? And this function,
I wanted to have an input of type of float, and I want to call
it Trottle value. Okay? Now, with this function. We want to set the position,
but how we can do that. We have throttle image, right? But if we say set
position, okay? It has a set get slot position, that is not the
one that you want, because this throttle image
inside the canvas panel, we should tell our real
engine that give this to me as a as canvas slot. So give it to me
as a canvas slot. And in the canvas slot, we can set the position easily. We say set position,
and that's it. No, we can set the
position for X and Y. This as you know, if you go to designer, the position X, we
don't change it, just the position Y we
want to change, right? So we can make a vector
two D. So go down in here, make a vector D because we want to just change
the position Y. But can we just
connect this to Y? No, because the throttle
value is a value 0-1. If you remember, the throttle
value is a value 0-1. It won't be more than that. And we know that the
throttle at maximum is one. And this image, when the
throttle value is one, the position Y should be -200. So whenever the
throttle value was one, the position Y should be -200, and when the throttle
value was zero, the position Y should be zero. How we can do that, it's easy. We can just multiply
this value -200. Just think about it. If you multiply zero -200, it will give us zero in Y, connected to here, of course. And if you multiply -200
by one max throttle value, it will give us -200. That's it. Now, let's just use
this function inside or BPF 18. Where can we use it? First, we can use it in Aventiq, but the best option is to use it whenever we change
the throttle value. So before setting the trotle, we can get the F 18 UI, right, and set Trotle
in there, right? Just like that, connected like
this, connected like this. The throttle value,
we give it like this. And we need to do the
same for break as well. In here, we did break, and we changed the
throttle value. So control to paste it over here and connect it like this. Connect the value. Now,
let's just see the magic. If you run we game, you can see the throttle. If we hold cheap, you can see the throttle is
increasing and it's going up. And we can decrease it as well. You can see it. Cool, right? We are decreasing and increasing the throttle value really
easily, right? Cool. Now we have a UI that
show throttle value.
21. 19 Set pitch input: No fighter jet can
change the throttle, can have some trust. It can go forward, right? But we can't bring it
up or down manually. It will go up automatically, but we can't go up
and down manually. Let's see how we can do that. If you go to our
blueprint F 18 in here, you can see for
going up and down, we need to change the
rotation around the Y axis. You can see Y axis is this way, and we want to change the rotation around
the Y axis, right? And rotation around the
Y axis is called pitch, so we need to change the pitch. For doing that, we
need the input action. For example, if we T we want the pitch of our fighter
jet to go down like this, to rotate like this, right? But if you S on our keyboard, we want the rotation of our
fighter jet to be like this, to go up, right, like as combat games, like any fighter
Jet game, right? So for doing that, first of all, we need the input action. Go to inputs folder
in here, right click. Go to input and
create input action. I want to call it IA pitch. Okay, I a pitch. Because with this,
we want to change the pitch of our fighter jet. Don't click on it to open it. The value type, I want
it to be a aces one d because either we are going up or we are going
down. That's it. No, let's just save this.
We can just close it. Go to IMC fighter jet, the input mapping context, create a new mapping. We want to map the IA Pitch. Select the IA pitch and in here. First of all, we want to do
it for W. Click in here, hit W on your keyword, and it will put W there. Create another one by
clicking on add in here, and this one is for
S. So by default, what will happen in
here in IAPchevent, it will pass one whenever
we hit W, and again, it will pass one whenever we hit S on our
keyboard by default. What we want to happen
is to pass one when we hit tool and pass
minus one when we hit S. So we need to add a
modifier to the S, right? So add the modifier in here, the type should be negate, so it will give us the
minus one, and that's it. Now we can go to
BF or blueprint, go to event graph, no in here. At bottom, we can search
for pitch, right? The event. And in here, whenever the pitch
IA pitch trigger, either with W or S, we can change the pitch
of our fighter jet. And how we can do that, we can get the vehicle
movement component. There is a function inside
it that it's called pitch. Set pitch input, right? It is inside the vehicle
movement component. Whenever the IA pitch triggered, we want to change the pitch of our vehicle movement component
with the action value. Now, with that, let's just
compile save and Runo game. If we have told
you, you can see, I can change the
pitch like this, go up and down. You can see, I'm doing it,
not automatically happen. I can go up and
down with W and S. But right now what problem that we have whenever
we have told you, the pitch will be one
and it will stay there and it will rotate or plain. That's not what we want. Whenever we release or S, we want to change
the pitch to zero again because this
pitch is not in degree. It's a value between
minus one and one. If you put one, it will
continue rotating. If you put one in and you
don't set it to zero, it will continuously rotate until you hit
something else, right? But we don't want
that to happen. What we want to
happen whenever we release the W or SK
on our keyboard, we want to set the pitch and
put back to zero, right? So we can copy and paste
this function in here. The function is inside the
vehicle movement component, so we need to connect the vehicle movement
component to the target. Whenever we release or complete the W or
SK on our keyboard, we want to change the
pitch to zero. That's it. It's just a compile,
save a run over game. If you hold Shift you can
see I can lift up down. And if you release the dolly ki, you can see it will go forward. If I had S, again, release the dolly kick,
it'll go forward. It won't rotate
continuously, right? That's it. Now we are setting the pitch of our fighter jet.
22. 20 Modify Bone: No fighter jet can go up
and down with W and SK. But the problem is there is no visualization
for change in lift, change in pitch, right? So let's see how we can
add some visualization. If you go to Viewport, you can see or fighter jet has some elevators that we can rotate like a real fighter jet, and we have some things
in here that called Alon that are on the wings, and we can change the
rotation of them to show the elevation or lift. Or the pitch, right? So for doing that, I want to go to a skeletal mesh in here. If you don't know where it is, you can go to content
drawer, go to assets, go to meshes, FATen in here, and you can see
the skeletal mesh in here. You can open it up. And in here, if I
search for elevator, you can see left elevator, if I go to it, you can see, I can rotate it like this. And this is a good visualization
of the lift, the pitch, changing pitch because
in real fighter jet, we changing the
rotation of this stuff, we go up and down. And like that, we
have Aloron as well. If I search for it, you can see like this one, I can bring it up and down. And what do you want to do? We want to change the
rotation of all of these so we can have
some visualization if we are going up and down. Of course, we can see the fighter jet that
is going up and down. But if you don't rotate these
elevators and ailerons, it won't look that good. So next thing that I want to
talk about is the spaces. You can see there is a
couple of ways that we can rotate our
elevators and Aerons. One in bon space, one reference and
one mesh relative. The important thing is
that we want to change the rotation of our
Aeron and elevators. In bone space. So click on bone. You can see we want to rotate it around the Yxis that
is called pitch. You can see rotation around the Yaxs that is called pitch. So we want to change the pitch
of elevators and lerons. And how we can do that, we can do it in animation Blueprint. Open up animation Blueprint. I want to make a little
bit of space in here, and the node that we can
do these kind of things is called modify bone or
transform modify bone. And put it there, you can see there is lots of
options in here. What you want to change
is just rotation pitch, not rotation X, not rotation Z. We don't want to
change the translation or location or position, and we don't want to
change the scale. What I want to do first in here, I want to make this
translation and scale hidden. So click on the node, and in detail panel
for translation, I want to click in here and tell it not expose it as a pin. You can see, no, it's gone. I want to do it for
a scale as well. Click in here and don't
expose it as a pin, right? Next thing that I want to do. I want to right click
on this rotation, split the stroke pin because we want to just change
the rotation, Y or pitch, right? Next thing that we want to do, we want to go to
detail panel in here. For rotation mode,
I want to change it from ignore to add
to existing, right? Because our elevator and the ailerons maybe have
already some rotation. So with this add to existing, we can change it up
and down, right? It will be easier
with AD to existing. Next, the rotation space, I want to change it to bone and space because it's
easier to work with. It will be based on
the rotation that it has relative to its parent bone. And that's the easiest
way that we can do it. That's the way we should
do it, of course. Next thing, we should decide which bone to modify to
modify its rotation. First thing, let's just
do it for elevator. So search for elevator. That's it. Choose
lef elevator joint. Now, in viewport, I can
zoom on left elevator. You can see it over here, and know with that if I compile
and change the pitch to, for example, 45 degree
and head compile. No, you can see the pitch left elevator is changed we
changing it inside this node. If I put it on 90, of course, you
shouldn't do that. Head compile, you can
see, no, it's 90. If I put it on ten
and head compile, you can see no rotation is ten. We can just put
it on zero or no. Another way that we
can test this pitch in here on this node is
by creating a variable. So go to variable,
create a variable. I want to call it
pitch value, right? The type, as you know, it should be float
because this pitch is just a float, right? Head compile, we can just
connect this pitch value to our pitch in here,
Headcmpile, nothing happened. But if you go to
Anim preview Editor, if you don't have this, you can just go to Windows
Anim preview Editor, make sure it is enabled, and you have access
to pitch value. All the variable
you can change over here and see the result
in the viewport. You can see I'm
changing things in here and you can see it
in viewport like this. You can see I'm rotating it. I want to put it
on zero for now. That was another way
to test this note, creating a variable
and use it and use the An preview editor to change the value to see
the effect in viewport. That's it. Know
what we want to do. We want to change that pitch value based on the pitch that we sit over here. Let's see how we
can do that next.
23. 21 Pitch value: No, we want to change the
pitch of the elevator and Aarons based on the pitch that we change insight or blueprint. Let's see
how we can do that. For doing that, we need a variable insight or blueprint
in here as well, right? So let's create a variable, and I want to call
it pitch value. So the name in here,
and the name that we choose inside our animation
blueprint is the same. That's good, right? The
type should be float. No, let's just set it, right? We can just set it like this set the pitch value like this with the value that
we have in here, right? And we can use this like this, so it will be easier. When we hit W, it will pass one. The pitch value will be one, and the pitch in here
will be one as well. When we hit S, this
will give us minus one, and this will be minus
one as well, right? Again, we want to set the pitch value in here
as well to zero, right? When it is completed, we want to put it to zero. That's it. That's
all we need to do. Now with that done, we can go to our animation Blueprint and
get that pitch value in here. And how we can do that, we
can go to event graph, right? First thing first, in here, we want to get an
instance of our BPF 18, and how we can do that, there is a note that is called Troy, get Troy, get pawn owner, right? And with it, it will give us the owner of this
animation blueprint, the blueprint that are using this animation
blueprint, right? But this doesn't know what is the type of owner that
we are getting, right? You should tell it by a casting. We can say cast two
BP F 18, right? I need the execution pin. We can use the gameplay in here. Event Blueprint begin
play, right? That's it. This will happen one time
when we play the game, right? Now, with this, we can
right click on it, promote it to a variable, and I want to just
call it BPF 18. That's it. Now we have access to BPF 18 inside or animation
Blueprint everywhere, right? Now, with that done. First thing that I want to do, I want to get over BPFeighteen and check it if it is valid. So the search for
is valid like this. You need the execution pin,
so let's just give it that. If it is valid, what we want to do we want to get
the pitch value. So search for pitch
value, get pitch value, and we can set this pitch value with the pitch value that
we get from BPF 18, right? Like this, if it is
valid, right? That's it. Now we have access to pitch
value inside our blueprint. Let's just see how
we can use it. You know that this pitch value
that we are getting from BPF 18 is a value between
minus one and one. And in here in Anning graph, you saw when we change the pitch value to a bigger
value, like, let's just see. Like ten, you can
see some effects. So a value between
minus one and one doesn't do a lot of things. You can see there is a
little bit changing here. That's not good enough. If we play our game, it will change. Let's
just look at it. It will change a little bit, but it's not too much. We can't see it clearly, what we can do, we can
multiply this by a value. For example, let's
just multiply it by ten and connect it to here. Now if you run over game
and heads, you can see, it's changing the pitch
of left elevator, right? Everything is working fine. But right now, the problem is
it will snap to the place. You can see it will
snap to the place. It's not smoothly change.
We will fix that. But before fixing that we need
to do the same transform, modify bone for other elevator. We want to do it for
the ailerons, as well. So this is a challenge for you. Do this node, modify bone
for the right elevator and all the lurons and we will do it in next
video together as well.
24. 22 Aileron and elevator: Let's see how we can do this note for all the
bones that we need. I want to show you a easy way. We can use Control C control we paste it over here, right? Connect the execution pin to it, connect the execution
pin to here as well. We can just use this
value for both of them. So let's just connect
it to here as well. And in this bone, we want to just change
the left elevator joint to right elevator joint. So search for elevator and we want to do it for
right elevator joint. If you compile and
run, you can see, now, both of them are changing, and that looks good,
right? That's it. No, we want to do
it for ailerons. Let's see how we can do
it. Bring this here. So we have some space in here. This time, I want
to copy and paste two of these in here like this. And the only thing that I want to change in here is the bones. So click in here, and I want to search for Aeron. First thing, left
Aluron inner joint. And after that, again, search for Aleron for
this one as well. Left aileron, outer joint. That's it. We can
just use this value, but I don't want to just
bring all of these to here. I can just select these two, Control C to copy it and
control V to paste it. It's okay to do these
kind of things, right? Connected to here and
connected to here. Let's just hit Compleo
and you can see that left Aleron is working fine
with elevator. That's good. We want to do it for
right Aleron as well. Control C Control V to
paste it over here as well, and connect it like this. Right? Now again, I want to copy
and paste this one to here. It's okay. It's optimized.
Don't worry about it. We could just connect
this from here to here, but I didn't want it to mess
things up, right? That's it. We need to just
change the bone in here to write
Aleron inner joint, and this one, write Aloron Let see Aleron right Aloronoarjoint. You can see it up here, right Aloron inner joint,
right, AloronOerjoint. Let's just compile
and run over game. You can see, no, the Alorons and elevator are changing its
rotation, and that looks good. But the problem is it is
happening really fast. It will instantly go
to that rotation. We don't want that to happen. What we want to do we want to smoothly change the rotation
of Aluron and elevator. We can do it with Ain terp too, and I will show it to
you in next video.
25. 23 Finterp to for pitch value: Now we are changing the pitch of our elevator and Aaron
based on the inputs, the IA pitch, right? But it happens so suddenly
that it doesn't look good. We need to smoothly
change it to the values. So let's just go
to our blueprint. In here, we change the pitch 0-1 and from zero to minus one, from one to minus one, from minus one to
one really fast. So we need to
smoothly change it. First thing first, let me
create some space in here. We want to use a node that
is called a interp too. We did work with it in here. You can see it can
smoothly change a variable to a target value. Doesn't matter what is that target value,
we can change it. We need just a variable. We have the pitch value
variable, so let's just use it. And here we say F
interpreter. That's it. The current value
that we want to change is pitch value, right? And the target is
the action value, for example, one or
minus one, right? The Delta time, we can
get it from G word, Delta second, that's it. Next, the interpos spit, I want to put it to five. No, I will give us a value each frame until it
reached the target value. And we can save that value
inside or pitch value, right? That's it. Just
put it over here, we head compile
and run over game. Now, if I L, you can see it smoothly changed
to that position. But, again, if you hit, you can see it will smoothly
change its rotation. But the problem right now is that when it want to go to zero, it happen fast, but when it want to go to
one or minus one, it won't happen fast, and it does look good. You can see it does look good. But for going to zero, it doesn't look good. It will go to zero really
fast. How we can do that. As you know, this
trigger happened 60 times per second or
30 times per second, based on your PC, right? So this ein ur too needs
something like that, like trigger to happen 60
times or 30 times per second. But this complete will
happen just once. It won't happen 60
times per second. It will happen just once. So how we can use
this F interp to interpret whatever
value that we have inside this pitch value
variable to zero. How we can do it, we can
do it with the timeline. So dragon draw
from here and say, search for timeline, right, add the timeline, I want
to call it pitch 20. Okay, pitch to zero. Inside this timeline,
we don't want to add any tracks, just the length. We want to put it to
two. So for 2 seconds, it should go to zero, right? We don't need to add anything in here. We
can just close it. So this timeline, when we play it will execute
whatever that is connected to the
update 60 time or 30 times per second
for 2 seconds, right? So with that, we can smoothly change the pitch
value with this Fin turf to. So this is Control C, Control V to paste all of this, and we want the
target to be zero. So the pitch value go to zero. That's now, let's see
if it's work or not. If you compile and run by headw, you can see it
smoothly go to one, and if I release it, it will
smoothly go back to zero. So that is working fine.
But there is a problem. I head W, and after
that head is fast, you can see, it's not
rotating that much. Why that is happening, it's because this timeline
didn't finish its 2 seconds. We shouldn't let it. Whenever there is a new input after another input released, this timeline may
not be finished. So we need to stop this timeline whenever
there is a new input. For example, when we W and
when we release the W, suddenly we S. You can
see that's a problem. It's not rotating that much. It's because, again, the
timeline is not finished. We need to stop the timeline whenever there is a
new input in here. So what we can do whenever
there is a new input, this start will happen. With this start, we want to say, stop the timer first, and after that, you can go to whatever value that you
want that you have in here. First, this started will
happen and after that, the trigger will happen. And that is good. But the next thing that we
want to do we don't want to play this timeline from
where it's stopped, right? If at the middle of this timeline and we stop
it, it will be at middle. And if you play it again, it will play it from middle. So what we want to
do, we want to change this execution pin from
play to play from start. So each time that this
timeline happened, it will happen from the start. So it will play this
for 2 seconds for sure, every time that we
release W or SK, right? Now with that down. Let's just
compi and run with a game. If I had S and really fast W, you can see it's
smoothly changing to zero every time and it will smoothly go to
one and minus one. Everything is working fine. Let's just go up in the air. You can see I can go up and
look at the elevator and Aleron can see how beautiful it is working, let's
just play with it. Go up like this. And increase the
trotle maybe, right? Cool. And increase
the trotle as well. That looks good. Next thing that you want to do, we can connect this pitch
value to here as well. But without that, it
looks good as well. Everything is good for
elevator and Aeron. If you again hold ship and go up in the sky
with the new changes. Everything is working fine, and it looks good and beautiful. If we release again, you can see it will be stead. That's cool. Now the next a
theme that you want to do. Whenever we have B
or A or keyword, you want to change the role. This can be a challenge for you. Try to do it yourself. You will do it in a
couple of future videos.
26. 24 Roll input: No airplane can go up and down, but it can't roll. It can't go aside, right? So we want to do the rolling. This rolling can be
a challenge for you. There is nothing new in here, one note that I want you
to try to do it yourself. If you are a beginner,
just continue with me. But if you are not a beginner, you should be able
to do that yourself. Let's see how we can
do that. For doing it, first of all, we need an input. So let's just go to
content drawer in here, go to fighter jet, go to
input in here, right. Click. Again, go to input, create input action, and I
want to call it IA roll. Okay? And let's
just do click on it because either we are rolling
right or rolling left, the Axis one D is
more than enough. So change the value type
to Axis one D. That's it. Head save, and close it. Now, we should go to
input mapping context, create a new mapping. And in here, we want to
map the IA role, right? And for this IA role,
we have two inputs. So let's just add two input. One for D and one for A, right? So that's it. Whenever we
hit D, we want to pass one. Whenever we hit A, we
want to pass minus one. So we need to negate
the A in here. So click in here to add a modifier and click in
here and choose negate. Now, let's just save it to
see if it's working or not. I want to do it
down here. I roll. It is up here. It is
enhanced action event. So let's just put it there. I want to use a printer
swing to check that out with the action value. Now, let's just run over game. If I D, it will give us one. If I had A, it will
give us minus one. So everything is
working fine in here. Now, let's see how we
can change the role. How we done it for pitch. We get the vehicle
movement component, and inside that there
was a function or node that is called set
pitch input, right? We have it for role as well. So we can get the vehicle
movement component, and in here, we want
to set roll input, no. That's it. This is
connected to here. Connect the action
value to here, no let's compile and run. No just add some truffle, go up a little bit, so we can roll a little bit. Now, you can see we are rolling. But the problem is, when we are rolling
to the right, it will continuously
roll to the right. It won't go to zero. You can see it's like so, right? So let's see how
we can fix that. Whenever we release D
or A on our keyboard, this complete will happen. And in that case, we want to
set the roll input to zero. So let's just copy and paste the set roll input with
control C control, right? And whenever we release
D or A on our keyboard, we want to set the roll to zero. Now, let's just check that out. If we run our game, add
some throttle or truss, right? I can show up. And no I can roll. You see, let's stay there, and we can move
like this as well. Everything is working fine. We can roll as though. Cool. Next thing that you want to do, let's just go to
a skeletal mesh. When we roll, how a fighter
jet roll a fighter jet roll. I can use its urons
and elevator to roll. For example, if this aileron
and this elevator goes down and this aileron and
this elevator goes up, it means it can rotate
like this, right? So, based on the roll value
that we have in here, we can control the bones
for elevator and aileron, so it does look better. Let's see how we can
do that in next video
27. 25 Roll aileron and elevator: No for actually showing some
visualization for our roll. We can just rotate elevator
and Al Runs for showing that. Let's see how we can do that. For doing that inside
blueprint F 18, I want to save the roll value. So we need a variable. Create a variable, and I
want to call it roll value. That's it. The type of it, as you know, is just a float. We want to set the roll
value in here with the value of action value
that we set it over here, and we can just connect
it to here as well. Connect the three here to here, can connect this to here. That's it. It is exactly
the same as before, but we are saving the
role value always. And when it's complete, we want to set the roll value to zero. But this time, I want
to show you something. You see, when I want
to set something, I dragon drop in here
and it will tell us, do you want to get
it or set it, right? On a holdout, get the roll value and
release Leftmost button. You can see with this, we are
setting it directly, right? It needs the execution pencil. Let's just give it
that, and that's it. Now we have a variable that
is saving our roll value. We need to get it inside our animation blueprint
first in event graph. We can just get the roll value. Just search for roll value. And in here, let's put it
over here and in here, we can right click
on it, promote it to a variable, and that's it. The naming is good
enough, right? So with this role value, we want to change the ailerons and elevators
rotation, right? So let's just make
some space in here. I want to add some comment. For example, this one, I want to grab all
of these head C, and I want to say pitch. And here we are using the
pitch, right, like this. This is for pitch. No,
we want to do the roll. For the roll, we need
all of these, as well. So grab all of this. We don't need to set
all of them again. These nodes are for
elevators and urons. We can just select all of them, Control C to copy it and Control V to paste it
over here. That's it. This way, it will be faster. I need execution
pin or pose pin, whatever you want
to call it, and we need to connect
it too pose as well. That's it. Now how we
want to control this. Let's just do it for
elevators first, and after that, we
will do it for urons. As you know, we need to control the rotation of our elevators with the roll value this time. Get the roll value and in here, because the role value is a value between
minus one and one, we need to multiply it
by something, like ten. Okay? And as you know, we need to change the pitch
of elevator, elevator. It's a little bit
confusing for some of you because we are
using roll value. Why why we are not changing
the role value in here. It's because this elevator is just changing in
pitch, not roll. No fighter jet change the
rotation in roll in elevator. No fighter jet changed
the role of its elevator. It's not realistic,
right? So that's it. We know that we need to change the pitch value of elevator
with the role value, right? I know it is a little
bit confusing, but you will understand
it. Don't worry. In here, I want to make
a little bit of space because I want to have some
comment in here as well. So what we want to do when
we hit D or keyboard, we want to go right. Okay? And the left elevator, we wanted to have, for example, this direction and
right elevator, we want to have this
direction, right? Opposite direction. How we can create that
opposite direction, we can multiply this
role value by ten, for example, connected
to the pitch. And after that, multiply
this role value again. This time, not by
ten, by minus ten. Let's just look at that connected
to the pitch because we are changing just the pitch
because in every fighter jet, we can just change the
pitch of elevators, right? We can change the roll.
It doesn't look good. So now with that,
whenever we head D, value one will be
in this role value, one multiplied by ten. I will give us ten
for left elevator, and it will give us minus
ten for right elevator. Let's just look at
that. If you run over game and head D on or keyboard, you can see, No, the
left elevator is like this and right elevator is like this. You can see it. Cool, right? We want to do the same for the Alorns as well. So let's just go here. For left aileron, we want
to multiply it by ten. So let's Control C, Control to paste it over
here for the pitch. Like this. And again, let's just copy and
paste it one more time. For the right aileron, what we want to do we want
to multiply it by minus ten. So the direction
that the elevator and Aaron are rotating
in each side, right and left are different
than than each other, right? It's opposite of each
other. So that's it. Let's just connect
it to the pitch. Make sure it is
connected to the pitch. Let's just compile and run. No, you can see when we head D, the left aileron and
elevator is like this, but the right one is like this. Can see? That looks good. Let's just go into a sky. It looks much better. Go up. Go right, you can see it. Go left, go right. Go left. You can see the
aileron and elevators clearly. But as you know, the problem that we have with this aileron, and elevator is that it's
snapping to the place. We need to smoothly
change the role value. Again, this is a
challenge for you. Try to do it yourself, and we will do it next.
28. 26 Finterp to for Roll: No, we want to smoothly
change the rotation, the pitch rotation based on
the role of our fighter jet. And here, like we have done
it for the pitch value, we need to use Fin Terp to
interpret the target value. So let's just go and do
it for this one, as well. We want to make some
space like before, we have Finerp too. We can just copy and paste it. You try to do it with
copy and pasting. It is really important, but I want to explain
it one more time. We want to smoothly change the role value from what it is, doesn't matter to a target value that in this case is
action value, right? And this F interp two
needs a Delta second. We can get it from
for Delta second. That's it. And the
interpose bit, I want to put it on five. And each frame, each time
that this trigger happen, we want to update
the role value with the value that this F
interpret gives us. So let's just connected to here, and that's it. Oh, right? Now, if you compile
and run over game, can see if I hold D, can see it smoothly change. If I hold A, it will smoothly
change. That's good. But the problem is with
this going to zero. Like we did it in here, we need to create a timeline and use it exactly like
we did it in here, right? So no, when we release
D or A on keyboard, we want to create a
timeline in here, add the timeline, and I
want to call it roll 20. Inside this, I don't
want to add any track. I want to just have a length. That's it two is
more than enough. You can just close that up. You know that every
time that we release the D or a key on our keyboard, we want to play from start. We want to play this
timeline from start. And whenever there is
a new input, D or a, doesn't matter which one
this started will happen, and we want to stop
the timeline, right? That's it. Now, we need to add a Fin turf in here as well. We can just copy and paste this because we did it one time, and that's more
than enough, right? Just put it over here, and the only thing that is different is that the target
should be zero. That's it. It just compile, save you can just connect this to here,
but I don't want to do that. You try you do what
you want. It's okay. Now, if I had D, you can see it's working fine. If I release it, how beautiful it go
back in its position. If I had A, again, it's working fine.
That's cool, right? And if I hold Shift at
some trust, I can go up. You can see everything
is working fine. And if I have, you can
see how beautiful it is. That's really cool. We
can go left, right, and elevators and Arons
are working good. No next thing that you want
to add. Let me go here. We want to be able to
go to right and left like this with E and
Q on our keyboard. And how it happened with this in here. That
is called Roder. We can just search for it Roder. Left joint Rudder, you
can see it over here. And this time, if
I had told you, I can see it how I
should rotate it. You can see if I rotated around the Z axis that is
called Ya you can see, I can bring it left and right, rotate it left and right, and that's how we want
to rotate it, right? So first thing first, we want to change
the yaw plane or fighter jet with E
and Q or keyboard, like Ace combat or
any fighter jet, they are using the same keys. And for visualization,
we want to change the Roder rotation
around the Z axis. You can see around the Z axis. This blue is Z axis. Again, this is a
challenge for you. Try to do that yourself and
we'll do it next video.
29. 27 Yaw input: It's time to be able
to go left and right. For going left and right, you can see it in here. We need to change the
rotation around the Z axis, right, so we can
go left and right. And we want to do it with
E and Q on our keyboard. So whenever we hit E, it will go right and whenever
we hit Q, it will go left. First, let's see how a
fighter jet can do that. If you go to a
skeletal machine here and let's just search
for Roder Okay, the fighter jets can
do it with the oder. You can see it over here. And if you rotate it
around the Z axis, we can have a visual
representation of that. You can see we can
rotate it around the Z axis for a visualization. And if you change the
Ya of our fighter get, it will go left and right. That's what we want to do. For doing that, we
need some input. So go to Content drawer, go to Inputs folder,
and in here, right click, create
a input action, and I want to call it I yeah. Okay. Don't click
on it to open it because if we are
going right or left, we want the value type to be float or Axis one. That's it. You can save it, close it, and know we need to map it. So in our IMC fighter jet, we need to create a new mapping. Let's just go down because
it is creating it down here. We want to map the IAR
select the IAA, we go down. We need two inputs, one for E, one for Q, one for going
right, one for going left. So click in here to add two
and no, first thing first, we need to add E. So
whenever we hit E, it will pass one,
and then second one, we want to add Q. So whenever we hit Q, we want to pass
minus one for going. And because of that, we need to add the modifier
so we can pass minus one. So in modifier, add a modifier of type of
negate. That's it. Now, let's just head save, go to over PF 18. Down here, I want to
right click Search for IA Ya and choose IA ja input enhance
action event in here. And with that, like we did it for roll input and
for the pitch input, we can do it for the Ya as
well for going right and left. Every fighter game
like Ace combat, use E and Q for going
right and left, right? We are doing the same in here. So we can get our vehicle
movement component, and inside that, there is
a set Ya input, right? And we can control the Ya with the action
value. That's it. We just compile and
run and hold cheap. It is going into
the sky and see it. Go up and know if I hit E, you can see it's going right. And you see it. But if
I release the E key, you can see it
began going there. So this is the problem
that we had before that whenever we release the
E or Q on our keyboard, we need to set the
input to zero, right? So we can just copy and
paste this over here, connect it like this,
connected to completed. So whenever we release
E or Q on our keyboard, we want the Y to be zero, right? Compile and know if I run
it can go up. Like this. If I have E, you
can see it will go right because it
has some momentum, it will go into that
direction over direction. After that, if you look a. We can rotate or plane
more as much as you want. You can see we are
rotating it with E and Q. But right now, the rudder, you can see it's not
changing at all. When we have Q or E,
it's not changing. So the next thing
that you want to do, we want to change the
rudder in here, Ya it. So it will represent the
turning right and turning left, going right and going left. This can be a challenge for you. Try to do it yourself. We will do it in next video.
30. 28 Rudder rotation: Next step is to add
some visualization. So when we have some input ya, we want to show it on the
odder of a fighter jet, right? So for doing that, let's just
go to blueprint in here. We need a variable like always, and I want to call this
variable Ya value. Okay? And the type as, you know, it should be float
and we want to set it. So hold all dragon drop and we can set it
over here, right? Exactly like that. And we can connect the input action to
here and from here to here. So it will be more
cleaner, right? And again, we want to set the
O value from here whenever we release E or Q on our keyboard to zero,
right? That's it. Now, we want to get this value inside our animation blueprint. So open up animation blueprint. I want to do it at
the end in here, and I want to add some comment. This one was for roll, just select everything,
head C on your keyboard, right, roll. That's it. No, we have two oder, right? So we can just
copy two of these, paste it in here with Control V, and connect it like
this. That's it. Is connected like this. And if we go to skeletal
mesh, left Roder, you know that we want
to change rotation around the Z axis
that is called Yo. So in here, the only thing that we want to do we want to click on this one, for example, and
search for rudder, right rudder joint, and this
one for left rudder joint. So search for rudder,
left rudder joint. And no, we have to modify bone. We want to control
the ya it, right? But with what with the Ya
value inside or blueprint. So we need to get that. How we can get
that, we can go to a vent graph from BPF
18 variable in here, we can get Y value, get the yo value, and we can right click on it, promote it to a
variable, and that's it. We can give it the
execution pin. No, we have access to Yo value
that is inside or BPF 18. Make sure you save everything
and no go to anim graph. We need to get this yo value. Get it like this.
And as you know, the yo value is a value
between one and minus one. So what I want to do I want
to multiply it by some value. For example, let's just
test 50, right? Why not? Just connect it to the Ya
this time for both of them. Now, let's just compile. We can test that out from here. Let me make this
bigger so you can see it better like this. And in the Anim preview editor, we can test that out. You can see it can go left and right, so
everything is good. Let's just compile, save
and run or game now, to see if it's working or not. Head E can see it's working. Now, let's just hold shift to see if it
looks good or not. Go up here and head E, you can see it can go right. Of course, maybe you say that the direction when
we had E on or keyboard, the direction of the
rudder is not okay. If you want to reverse this
direction, how you can do it, you can just say, multiply it by -50 instead of just 50, right? Let's just see it now. If I E, now you can see, it's going in opposite way. You can see oh, that's good. Again, 50 is a lot, so I want to multiply
it by -25 maybe. 25 is more than enough. Let's justtst that by head E.
I think that looks better, but we can increase it a
little bit by -30 maybe. You decide what you want to do. If I run over game, again, let's just go into the Skype and you can see everything
is working fine. If I head E, you can see. It's going left and right, but it happens so
suddenly we need to change the rotation
or rather smoothly, and how we can do it, we can
do it with afin Terp too. You try to do that. We
will do it in next video.
31. 29 Rudder Yaw Finterp to: No, it's like before. We need to smoothly
change a variable from whatever value it
has to a target value, and we want to do
it with a finer. Let's see how we can do
that. For doing that, we need some space in
here, like always, right? And in here, we need
a fin terp too. What you want to interpret
is the ya value. This is the current, right? And the target value
is action value. The Delta time is get word, Delta second. That's it. And the interpose speed is five. And we want to set it every frame with this
value. That's it. Now for going to zero, what you want to do, we
want to create a timeline. So let's just add the
timeline in here, add timeline, ya to zero. For the naming, I
think it's good. And I'll click on it. You know, that the length
you want it to be two. That's it. That's
all we need to do. We can just close it in
a vent graph in here. You know that whenever we
release E or Q or keyboard, we want to complete to be connected to
the play from start. So every time that
we release EOQ, this timeline will execute update execution pin for 2
seconds, every frame, right? And whenever there
is a new input, we want to stop this timeline. That's it. No, we need another Fin terp
for going to zero. We can just copy and paste
all of these over here. Let me organize a
little bit like this. And connect this
value to your value, but the target is
zero. That's it. Easy, right? Compile, save. And if I run over
game, if I have E, you can see the
smoothly go right and it will smoothly
go with the middle. Again, Q, E, you can see
how beautiful it is. Let's just Take it for a
sum in the air, right? Now plane can go right
and can go left. You can see. And I think
that looks beautiful. That works really fine. We can go up, we can go down. We can like this and
we can go like this. We can see everything
is working fine. Every bone is working fine. No next thing that
you want to do. You can see these
wheels plane on our fighter jet
is outside and we want to have a way
to bring it inside. So close the gear, the wheels, you can do
that in future video.
32. 30 Front chasis joint: Now it's time to actually
be able to bring the gears up and down and how we can do
that. Let's just see. If we go to our skeleton mesh, I want to start
from front wheel. If in a skeleton tree
search for front, you can see there are
some bones that we need to change a rotation. For example, we have front chassis joint
zero. You can see it. We can just click on
it, and as you can see, we need to change its pitch like this so it will be inside. For example, 100 degree. I think that's good. After that, there is front chassis railroad. We need to bring
this inside as well. For example, 30
degree, that's good. No, there is another thing. If I bring both of these down, let me show this because I
want this to be perfect. You can see when we rotate both of these,
they get disconnected. But in the real fighter jet, there is a hydraulic that
in here, we have it, that if we change its
location like this, it always be connected
to hydraulic, right? So what we need to do. First, we have two bone. One front chassis zero joint, and another front chassis rail
rot joint that we need to change its pitch to reach
100 rotation in pitch value, and we have another one
front chassis rail joint. We wanted to go for 240,
for example, right? And we have another bone that we need to
change its location. So it always looks connected. I don't want to show
it in here like this because when you
mess up this thing, nothing happened in actual game, you can see, I'm changing
this, we save it. And if you go here in Viewport, you can see it's a seal there. So whatever you do in
here in skeletal mesh, it won't happen nowhere. You can just experience with it. But in our animation blueprint, we can animate it. So for animating let me create some space and add some comment to these
ones from last video, I want to select
both of these heads, so we create a comment and I
want to call it Ya, right? That's it. No, let's just
create some more space. We want to change the rotation of two of the bones, right? So we need two of this note that we are
changing the rotation. We don't need to do
it from scratch. So control C to copy it. Control V to paste it over here, and give it a post pin or
execution pin like this. At compile. Nothing happened. What I want to do in here, I want to click on this one. This one is for front chassis, zero joint, just like that. This other one is, let me click in here,
front chassis ilod joint. That's it. We know that we
need to change its pitch. I did show it to you in here. If I click on here,
the rotation around the Y axis is this green that we want to do. We
want to change it, right? The pitch of it, right? So it is the pitch,
rotation around the Y axis. So in here, if I
change the pitch of the front chassis zero joint
to 50 and head compiled, you can see it's going inside. 50 is not enough, maybe 100. So let's just put it
there, compile and no, you can see if I look at it, you can see it's completely
inside, and that's okay. Now, we have another
one in here. So let's just change this. We know that. We want
to change the pitch. Let's just putt in here, head compile and you can
see it is going inside. Let's just put 13 there
and head compile. You can see, no, it's
completely inside. Both of the Bones
rotation, no okay. One of them 100 for front
chassis, zero joint, and one of them is
for front chassis, rail rot joint, right? 30 for pitch, and 100 for
pitch of this one, right? But we don't want to
test it like this. Each time we need to compile, right? What you want to do? We want to create
a variable inside or an in preview editor,
test it with that. I want to create a variable for that and I want
to call it gear. The type should be float, and we can get that like this. And I want this gear
value to be a value 0-1, because it's easier to work
with this kind of value, the value that is 0-1, right? So that's why we need
to multiply this, multiply it by some value. For example, this one,
100 is more than enough. So if the gear is zero, it means the gear is out. But if this gear
variable is one, we want the gear to be inside. So 100 for this one. So put 100 in here and
connect it to the pitch. Now, let's just test
that out. It is outside. If I go to gear and
change it to one, you can see if I
put one in here, no, you can see it is inside. It's really easy to work with. Now, for testing it
because we needed a lot, I want to click on
this gear variable, either here or here. And in the detail panel, I want to change a slider
range from zero. Two, one. Why I'm doing that? Because
no it's easier to change it. You can see, no, it's
easier to work with it. I'm changing the gear and
you can see it's going up and down up and down,
right? That's cool. Now, with this gear variable, we want to change this front
chassis rail rod joint. We know that if you put
zero for pitching here, it means it is outside, and when we put 30 in there, it means it is inside, right? So if you put zero in here, you can see it will be outside. You can see it. Now, again, we know that this
gear is a value 0-1. We can multiply this
by 30 because with 30, we know that the
gears are inside. All of the gears
should be inside. All of the wheels
should be inside. So connected to the pitch. Now, if I had compiled and
change the gear to one, you can see both of
them are inside. That looks good, right? But one problem that we have in here is that it's disconnected. Right now, it is disconnected,
how we can fix that. For now, we are moving
the front chassis, zero joint and front chassis
railroad joint correctly. Everything is good,
but it's disconnected. I will show you how
you can connect them together properly
with these notes. But see we can do that. Next we
33. 31 Hydrolics: No one problem that we had from last video was that the
gears are going inside, but at some point,
it is disconnected. Let's see how we can fix that. If we go to a skeletal mesh, let's say this front chassis
is like this, right? And this front chassis rail
rod is like this, right? And no it is disconnected. But we have the
hydraulic, right? We can change its position like this in X
direction like this. So it will be always connected. This way, you can
see it good enough, when we go to
animation Blueprint, you will see it better. No, we need another
one of these nodes, but the node that we need is
for changing the position, not the rotation anymore. So in here, dragon drop, search for modified bone. This time, what you
want to change, again, search for front. The thing that you
want to change is front chassis hydrojoint, right. And with that, we
need to just change the translation in
x direction, right? So we don't need this
rotation and a scale. You can leave it there,
but I want it to be clean. So that's why I go to
rotation and click in here, tell it not to
expose it as a pin, and for the scale as well, tell it not to
expose it as a pin. And right, click in here, split asteroid pin, so we
have access to just X, right? So let's just compile. Now in here what you want to do? We want to change
the translation X because I did show it to you in here that we want
to change the translation, the position in X direction.
You can see it over here. So no, we want to change
the translation X. But with what we
want to change it, we want to change
it with the gear. So all of them go
up together, right? So for doing that, we need
to multiply the gear, multiply this by a value. Let me put it over here, connected to the translation X. And in here, let's
just put ten in there. I know the right value, but I wanted to just show you. You can see, it's going out, but it's not good enough. Let's just increase that.
For example, to 50. Head compile. Again,
it's not enough. Let's just change
it to 100, right? Compile. And now you can see
it's inside, but not enough. Let's just put it on 110. Head compiled. No, you
can see it is inside. If we change, you
can see that works. Good. Now, you can
see, if I go up, everything look good, and
that looks, I think, awesome. It's moving correctly, right? No, with that done, the gears is going
out correctly. You can see that
looks beautiful. No, we are animating the translation and
rotation as well. No, next thing that
we want to do, we want to close the doors. For example, if the gear
are completely inside, we have some doors in
here. You can see it. There is one in here, one in here, and one in here. So next step is to
close the doors. Let's see how we can
do that in next video.
34. 32 Front gear door: Now we are bringing
the front gears up, but we are not closing the doors. Let's see
how we can do that. If we go to a skeletal mesh, you can see we have some doors. If we just search for door, you can see we have left
door one joint, you can see, we need to change its
rotation around the X axis. Let me show it to you. It is around the X axis. You can see the X
direction, right? So head E, this red one is
the X axis, the role, right? So we need to close
it like this. And we have other ones as well. For example, this one.
Again, around the X axis, we need to close it. And we need to do
this one as well. So you can see there is tree door that we
need to close it. That's that beautiful, right? You don't want to
do it like this. Don't worry about it. Nothing
will be saved in here. We go to ABP F 18. We need to change the rotation of some bones, so
it's easy, right? Let me create some
space in here. We need three of these nodes for changing the
rotation of the bone. Can see to copy three
of them and in here, paste it like this, connect the execution pin to it. Let me make this
smaller so you can see better and connect
these to here. Now for the bones. Click on the first one. If you search for door, I want to do it for
left door to join. The name is not that
good worry about it, but I'm showing you. This one was two. This one was one. And again, this one, we want to search
for door as well, is this one, right?
No, with that. We know that we want to change the rotation X rule, right? So let's just check it. If you go here, this one, if I change these 250, for example, and head
compiles this one, right? It's inside. Let me increase it a little bit. As you know, this way
is not good enough. We can create a variable
and test it with that variable because each time that you are changing
something in here, we should head compile so that's not good enough.
What do you want to do? We want to create a variable. And this one, I want
to call it gear. Door. That's it. It
should be a float. And I want it to be a value 0-1. That's it, head compile. Now we can grab this gear door, multiply it by some
value because it is 0-1 and connected to
the roll or rotation X. Let's just put like 50 in
there, start from that. And if I change the
Ge door in here, you can see it's going inside, but it's not enough. Let's just put 100 in
there and head compile. I think that's good, maybe it's going inside more. Let's just put 95 in there. I know the 95 is the best value there
for this fighter jet, and I think that looks good. No, let's just test it. For the Ge door, we can bring it out,
bring it inside. You can see close it and open
it just by this variable. That looks awesome, right? Let me go here to see if
it's closed properly. Let's just put 100 again. Head compile and I
think that's good. You should play with this value until you reach
the result that you want. Now, we find the
correct multiply value for the left door two joint. We want to do it for
the other ones as well. Multiply this by a value for
the left door one joint, connected to the roll
in here, compile, and let's just put
50 again in there, head compile, and you can
see it's going outside. Because every time that
we increase this 60, it will go outside more. We need to multiply it by a
minus value, like -50, right? So compile. Now, you can see it is going inside,
maybe increase it, -70, maybe pile, and now
you can see it inside. I think that looks good. Now, we need to do it
for the other one. Again, we want to do the same, multiply this gear
door by a value and connect to the row
for this one, right? Again, let's just start
from 50, head compile. It's going inside,
but it's not enough. Again, let's just put seven
in there and compile. I think that looks good, right? I go here. I think
that looks good. Let's just test that out. I think that looks good. Nobody will look at it this way, but we can, right? Why not? We can close it, open it, and we can close it. Open it and close it. That looks good, right? You can see some part of the wheel are outside.
You can see it in here. We can change that. For example, this 100
that we have in here, 105, right? Headcmpi. Cool. No, let's see
it from this side. If I open the gear
door, you can see it. It's working fine and
open up the gears. You can see that looks awesome
and it's going inside. So first, these
gears are going up, and after that, the gear door will close. That looks awesome. Now we have done
the front gears. What I want to do in here, I want to select all of these, create some space in here. Ads see on your keyboard
to create a comment. I want to call it front. Gears. Okay? That's
it. Head compiled. No, we have done
the front gears. Let's see how we can do that for the rear gears in next video.
35. 33 rear doors: Next thing to do, we need
to close up the rear gears, the back gears, the back wheels. Let's see how we can do that. For doing that, if
we go inside it, you can see there is some
space to put this one inside, but it's not enough. What I want to do,
first thing first, I want to close up the
doors first and after that, bring up the gears. So in here, I should search
for rear and you can see we have three of these doors in here
for the left side, that we close them to see
which one we should change. If I go here, you
can see if we have one in here that should
close like this. And again, we have one in here that should
close like this, and we have another one that should close like this, right? It should be closed like that. And after that, we can
close up this one, right, bring it inside
like this. Cool. There is a problem in
here that you can see. It is outside. We can
bring it inside like this. No everything looks good. This one is for the left one and it is inside,
and that looks good. I want to close up first the doors and after that,
bring up the girls. For doing that, let's just
go to Animation Blueprint. In here, at the end, I
want to create some space. As you can see, when
we click on the doors, we did change the rotation
around the X axis. You can see around the
X axis, this red one. The red one, if you look
at here is the X axis. So it is the role. Rotation around the
X axis is the role. So we need to change
the role of it. So now, let's just go to ABP F 18, the
animation blueprint. We need three of these
changing rotation. So let's just copy
three of these, control C to copy it and control
V to paste it over here. And connect the pose
pin or execution pin to here and to
output like this. And now, let's just choose the doors that you want
to close. Click in here. And here I want to search
for rear left rear door one. The next one is rear
next left rear door two. The name in this
time is good, right? So again, search for rear left rear door
three joint. That's it. We need to change
the role of them. Just zoom in here a
little bit like this. We are in good place, right? And that's good. I
think that's good. We want to use the gear door for closing all the
doors on our plane. So again, we can use
the gear door in here. As you know, because this
garter is a value 0-1, you can see it in
here, a value 0-1. We need to multiply
it by some value. So let's just multiply
it by some value connected to the rotation
around the X axis. Again, you want to multiply it for the door two for the X. Again, let's just multiply it one more time for
the door three. And put it over here
for door three, right? That's it. No, I want to
close the gear door to one. Nothing will happen in here, but we can put some value. So for example,
100 for this one. You can see it is closed. We can just go here
and test this out. G door two, you can see this 82, but I don't rely on skeletal image because it
doesn't work sometime. For door two, let's just test
50 there and head compile. It's not closed. Let's
just put 80 in there. Again, head compile.
It's closed, but let's just add more. 85 maybe. And I think we should go a little bit more. You
can see it in here. 87 maybe head compile
and no it is closed. Maybe 88 is better this time, right? Yeah, that's good. Now, the next door, let's just put 50 there. I always start with
50, D compile. You can see it is going outside, so we need to multiply it by minus value -50 head compile
and it's not closed. -80 again, head compile. It's not closed -100, right? Head compile. It's going
inside a little bit. So let's just increase
that -95 head compile, and that's closed, right? Now, let's just test that out. If we decrease the ge door, you can see the ge door is
going out and going inside. That looks good. Let's just see the whole plane with this. Go out. You can
see it over here. We have doors in
here, doors in here. If we change the gear
door, you can see, all of them are closing
and opening correctly. Let's just close
the gears as well. And no, let's just
test the doors. That looks awesome, right? Make sure you save everything. Sometimes our real
engine crash a lot. No, I want to give
you a challenge. Try to do the right
doors yourself. We will do it in
next video together. It's important to
do these challenges so you will remember this
kind of stuff in future.
36. 34 Left gear: Let's see how we can
do the right doors. For doing that, again, we can copy all of these. It's easier because it's just
a copy and paste, right? You should learn how to properly use copy
and pasting because right now we are doing one thing that is
exactly like before. We need to just change
the bones in here. So again, search
for rare we want to do the right door one
this time again in here. We need to change the
to rear door two, right rear door two, right? We have another one. Again, search for rear in here
and right rear door three. If you had to compile
and let's just go to the right door, find a good angle so
you can see it better. Now, if we close it, you can see it is going
outside completely, so it doesn't look good. What I want to do, I
want to put whatever that is positive to
negative like this, like this and whatever
that is negative, I want to put positive in there. Now, let's just head compile
and close the gear door. Oh, you can see it's working. So the right doors
are closing as well. Let's just close that.
Know what you want to do. We want to close
the gears itself. The wheels should be inside. But as you can see in
here what we have done, let me click in here and
reset the gears in here. You can see you
can't just change the direction and
everything will be okay. You can see it will be outside. So we need to
change the rotation into direction so it will
be completely inside. So for doing that, it's exactly like before, but we need to
change to direction. And I want to show you teach
to to do that properly. So for doing that,
we need one of these nodes for modified
bone rotation, right? Control C control V to
paste it over here, and connect it like this and connect it to the
output, and that's it. We need to use the gear variable to close
up those gears, right? But with just one of these, we can't bring diggears inside. We need three, two or
three of them, right? Either three of these or
two of them, at least. So first thing first, let's
just choose the bone. So I search for rear
rear chassis joint. If you go here, you
can see it's called left rear chassis joint and
right rear chassis joint. If we reset it, you can see it over here, right? So know with that, if you head
compile, nothing happened. Everything is at zero. The best way to find
good values in here, you can drag and drop
promote to variable, right, for the X. Again, do it for this one, promote to variable
for the pitch. Again, drag and drop, promote to variable
for the, right? Know what will happen. We have access to them. We are doing it for the
left one is this one. Let's just go close to it
and change some value. For example, this one, it should go this way, right? It is going inside. Again, change this value and change this
value to bring it inside and play with this value until you reach the result that
you want, right? No, you can see it
is going inside and we need these
values for X, Y, and Z. So what we can we
can multiply this. This one is for the role. The role, as you can
see, it is -119. So let's just put -119 there. Again, multiply this value. We need to multiply this
by a value as well. That is 15. Put 15 in there. Again, we need to
multiply this value. I minus nine, right? And we can just connect
it to these values. So let's just connect
it like this. If we know he compile
and change the gear, you can see it will be out and it will be inside.
That was easy, right? We just creating some
variables, we done it. We find what rotation each
one of these should have, and we are closing the
gears easily, right? This inside and outside.
That works fine. Now, again, I want to give
you this as a challenge. We did that for left gear. You try to do it
for the right gear, and we will do it in next video.
37. 35 Right gear: No for doing it for
the right gear. Let's see how we can do that. Again, we can just copy
and paste this, right? Let's just copy
everything, right? Copy and paste with Control C, Control V and paste it
over here like this. Now with that, let's
just click on it. We need to set the right
rear Chass is joint, right? Head compile. No, let's
just test that out to see if it's inside or not.
Of course, I can see it. It is not inside. So it is going not in the
correct way, right? So again, let's just test
it with these values. Find the better values, right? Connect these three
and test that out. Make sure you head compile
and bring everything to zero. So you can see
everything is at zero. Let's just change some stuff. Go here and you can see it
is outside of the chassis. So let's just bring
it down a little bit. And after that inside. So these are the values
that we need for this one. We can just control
C control V to paste it over here
for this one as well. This is for the pitch, and this is for the ya, right? So now, with that, if you connect them
to here, and here, you can see if I compile
and change the gears, you can see both of
them are going inside. Cool, right? Everything
is working fine. So what we have done, we
create three variables for finding values for roll
pitch and yo for the, the gears are inside completely. And after we find those
values with these variables, we did multiply those values with the gear variable
that is value 0-1. So that's how we are
closing the gears. Know what we want to do. We want to animate all of
these together. So whenever player at G
on their keyboard, first, the doors get open like
this and after that, the girls get outside like this. And after that, if they had G on their keyboard
again, again, first, the girls will go
inside like this, and after that, the gear door
will be closed like this. It will be easy to do, right? Let me test it with a
bigger viewport in here. You can see it clearly. No, first, the gear
doors are open, and after that, the
gears are outside. So that's it. That's
what we want to do. I next do. We want
to automatically close and open the
gears and gear door. For doing that, first of all, let's just delete all of this. We don't need it. And in here, I want to add some comments. For example, these
21 was for gears. So it was for rear years. So add the comment. Always good idea to
add some comment. So in future, if you want to add something, you can do it. And these ones is
for rear doors. Okay? And let's just organize a little
bit, and that's it. Everything is commented,
everything beautiful. Make sure you go to
file, save everything, and know it's time to go
and find a way to close it and open it with one
click, one keyboard hit. Let's see how we
can do that. Next
38. 36 Timeline for gears: Knowing our animation blueprint, we have two variable
for opening and closing the gears and opening
and closing the girls door. That's see how we can use them. As you know, just remember this. When we put the
gears door to zero, it means it is open. I know it doesn't sounds good, but that's how it works. And when we put the
gears door to one, it means the gears
door are closed. And as the same, when the gears variable is zero, it means the gears are down, and when the gears
variable are one, it means it is up, it is closed, right? So if both gears and
gears door are one, it means both doors
and gears are closed, and if they are zero, it means they are open, right? So we want to use that. How we want to use
that inside or BPF 18? Thing first, we need a input. So go to content drawer
in input folder in here, right click create
a input action. Want to call it IA gears. Okay. Do click on it open it. The digital boolean
is more than enough. That's it. Well, let's
just close that. We need to map it inside
or mapping context. So in here, add the mapping, go down in here and find it. We want to map the IA gears. And when do we want it to happen whenever we had
G on our keyboard. So click in here, head G on your keyboard and it
will put it there. Now you can save it and go
to Blueprint now in here I want to right click Search
for IGs gears, right? And in here, whenever we
head Jon or keyboard, this start will happen once. And with that, we want to
either open or close the gears. So we need a variable
to keep track of if the gears are open
or closed, right? So let's just create a
variable of type of boolean, and I want to call it is gear open with a
question mark, right? So we check. If the gear is open every time that we
had Gano or keyboard, so we can check this
with the branch. If the gear is open,
we need to close it. And if the gears is closed, we need to open it, right? How we want to do it, we want
to do it with the timeline. So let's just search for
timeline at the timeline. I want to call this one gears. Timeline, okay? Do click on it to open it. I want the length of this to be three second and add the
track at the flow track. I want to call this
one gears, okay? And in here, add a
key at the time zero, I want it to be zero and add another key after 1.5 second. So let's just put 1.5 second. I want the value to be
one. So what will happen? If we give these gears value, to the gear value inside
our animation blueprint, it will take one point half second to gears to
be closed, right? So first, we close the
gears, and after that, we add another track, and I want to call
this one gears door. Okay. And this one I want to
start it from 1.5 seconds. So let's just put 1.5 second. At 1.5 second, I want
it to be zero, right, and add another key in
here at time three, I wanted to go to one. So let me explain
it one more time. When we play this timeline, if you pass it to animation
Blueprint, what will happen? First, the gears will be closed, and after the gears is closed, the door after that
will be closed. And we have both of
these variables. So we have gears and gears
door variable, right? We can just promote them to a variable on each
update, right? That's it. Let's just promote this
one to a variable as well and update it each time that this update
will happen, right? So with that, if you
play this timeline, these gears will go to one, and after that, these gears is going to one and the
gears is closed. After that, the gears
door will go to one and the gears doors will
close after that, right? So how we want to play it? Let's just test it out.
If the gear is open, okay, we need to close it. And if the gear is not open, this false will happen, and we want to reverse
play this timeline, right? So let's just test
that out with justice. It won't work without any bug, but let's just test that out and we will fix whatever
bug that it has. If we go to our
Admission Blueprint, we need to go to event
graph and get those values. For example, gears, get gears. And we need to get the
gears doors as well. Get gear. Or gears door, as well. And we need to promote
them to variable. But this time because we have a variable for gear
and gear door, we can just set them
just like the set them. With these values that we are getting from our
blueprint, right? So the Gear doors, again, we want to
do it the same. We want to set it with the value that we get from blueprint. N the execution pin. So let's just give
it that like this, put it over here and give
it the execution pin. If you run over game and he go or keyboard, nothing happens. This is the first book
that it is happening. If you go to BPF 18, you can see the default value
for Is gear open is false. That's why nothing happens. So at default, the gear is open. So you can see it in
viewport. The gear is open. That's why we need to
put the Is gear open to true at the beginning. No, let's just to. If
you run over game, had Gian or keyboard,
no, you can see. The gear is closing and the
Gear door is closing as well. And if you hit ion or keyboard, nothing happens, so
that's a problem. I want to give you
this as a challenge. Try to find what is the problem and try
to fix it yourself, and we will fix
it in next video. If you can fix this, it means you are not a beginner
and you are getting good
39. 37 Open and close gears: So we had one problem
in last video. The gears is closing, but it's not opening after that. Why? Because we
have is gear open, it is true always, right? We are not making it false
or true after that, right? This timeline has a
finished execution pin. Whenever this timeline
get finished playing, it's timeline, it's keyframes. This finished will
happen each time. And after that,
we want to check. If the gears doors are closed, it means the gears are closed. So is gear opened
should be false, right? So let's just use a branch in here and check it
with the gears door. I want to check. If
it is equal to one, when it's finished plane. Let me go here to show you. If it's finished plane and
the gears door or one, it means the gears
are closed, right? But if it's reverse plane, it will start from
here and go to left the gear doors will be zero in here at
time zero, right? So in event grab what you
want to do, we want to check. If it is equal to one, if the gear door
is equal to one, it means I gear open is false. So let's just get
the I gear open, set it to false. But in other case, we want to use Control C
control V to paste it. We want to say true. Let me
explain it one more time. If the gears door value
on this timeline is one, it means the gears door
are closed, right? So this true will happen, and we say it is not open. I gear open is false, right? It's not open. But in other cases, it means the gear door is equal to zero or a value but one, these false will happen, and we set the Es
gear open to true. Now, let's just test
that. If you run over game and he G or keyword, you can see it getting
closed, everything look good. If I had G again, it will get open again and
everything looks good, right? Let's say, at the middle of this opening and closing,
we head G again. Nothing happened because that
finished is not happening, but after that finished happen, no, we can open it. Again, let's just head
G. You can see it is closed and after we wait, we can head G again to open it. Let's just test
that one more time. If we hit Shift on our
keyboard, you can see, I can go up and I can
hit G on our keyboard, the gear will be closed. Everything looks good
and looks beautiful. We can go way like this. And maybe we can learn it? If I a gon or keyboard,
it will be open. And I don't think
that I can land it, but maybe we can, right? So let's go down and touchdown. That doesn't look good. We have handbrake as well when
we are on the ground. But this is a simulation of a fighter jet in real engine.
That doesn't look good. We will calculate some stuff, so we will destroy the fighter jet whenever
these kind of things happen. So no, or gas is working fine.
40. 38 Check altitute: No one problem that we have is that when our fighter
jet is underground, we can close up the gears, and this shouldn't happen. Right? Now, we are underground. If you have on or
keyboard, you can see it. That doesn't look good, right? So how we can fix
that. Let's see. In here, if we had G on or keyboard and if
the gear was open, this true will happen, and this timeline will cause the gears to
be closed, right? But in case of this true, we want to check if
we are underground, don't close the gears because
we are underground, right? So for doing that, we
need some space in here. For checking if you are
underground or in the air, there is some nodes
that we should use. That's why I don't want to add all of those nodes in here. We don't have lots
of space in here, so that's why I want
to create a function. So go here, create a function, and I want to call
it check altitude. Okay? Check altitude. And in here, in this function, we want to have a output
of type of Boolean, and I want to call it is in air. Okay? And in here, let's just create some space. There is a node that is called line trace by channel, okay? This line trace has a
start and end location. It will start from that start location to the
end location with a line, and if it hits something, it will show it to us. So what I want to do
I want to add a line from the middle of
our plane to down, for example, 20 meter down to check if it
hit the ground or not. If it hit the ground after
1 meter or two meter, it means we are on the ground. But if it didn't hit
the ground at all, it means we are in
the air, right? So for doing that, we need
a start and end location. How do I want to get
the start location? I want it to be at the
middle of or plane. So let's just click on Ormsh. The start location of Ormsh
is 00 location in here. If I click on here,
you can see it. That doesn't look good. But if you go to our spring arm, you can see the
spring arm location is at the middle of or plane. So that's why I
want to use that. So in here, I want to
get over spring arm, get its location, get location, and get the word location of it. And this is start
point. That's it. And for the end point, we want to just subtract this by a Z value because we want to check if you
are on the ground or not. We don't need to change
the X or Y for that. So I want to put
2000, for example, or 20 meter down
connect it to the end. And for you to see it better, I want to change the
draw devocty from noon to persistence, so
you can see it better. If I head compile, no, I can use this function. So let's just go to vent graph. I want to show it to
you step by step. So grab this check altitude and connect the execution
pin to it like this. I don't want to close up
the gear just right now. I want to just
check the altitude, head compile and run over game. So if I had Jon or
keyboard, you can see, there is a line from the middle or plane if I go
forward a little bit. To the ground and
it hit the ground. It means we are on the ground. So it will give us a value. Let's see what is that value. How we can get that value
that we hit the ground, we can just break this out
had to give us the distance. So let me use a
printer string in here to show it to
you printer string. And I want to show the distance when it hit the ground, right? We run over game and
hit Jon or keyboard, you can see, it's
like two meter, right, two meter down. So if this distance was
less than two meter, it means we are on the ground. But if it is more
than two meter, it means we are in
the air, right? So we know that value, which is connect these two here. First thing first, we
want to check if it is hitting something
with this blocking head. So use a branch in here. If it didn't hit something, this falls will happen, and it means we are in the air. So we check if it is
in the air, right? That's it. But if
it hits something, we need to check the distance. So again, if it hits something, we can use a branch in here
and check the distance. If the distance
was greater than, for example, 250, okay? It means we are in the. So we can control C control
to paste this return node. And if it's not hitting
something after 2.5 meter or 250 centimeter, we can say we are not
in the air like this, passing falls to this
variable in here, right? So, no, let's just
test that out, no. If we go to event graph, no, I want to use a
printer ring in here, printesring to show you the
is in air value, right? Compile and run. If I had on or keyboard,
it says false. We are underground.
So it's working fine. We hold shift and go forward and go into
a sky, maybe, right? Now if I Gon or keyboard, you can say it's
hitting the ground, but it says true. We are in the air. Again, if
it's not hitting anything, if I Gon or keyboard, it's not hitting anything,
and it says true. So everything is working
fine with our function. We can just use a branch on this function is in
air with the branch. If we are in the air, this true will happen and
we can close up the cars. Let's just compile,
save a Runo game. I I hit Gon or keyboard, you can see we are
on the ground. That's why it's not
closing the cars. But if we go forward, and go into the sky. But this jeep, no, it will close up the gas. That looks good, right? So, no. We fixed another problem.
41. 39 Missiles and hardpoints: Next thing that we want to do, we want to add some missiles
to our fighter jet. Right now, or fighter
jet can go to the sky, but it can't attack anything. So let's see how we can do that. For doing that, if we go
to Viewport, you can see, if we go at the wings, we have some hard point. We call it hard point where we can put some missiles, right? And at the right side,
we have it, as well. We want to put four
of them in there, like any AS combat.
They have four, right? So for doing that, we need
to find the skeleton. Let's just go to content
drawer, go to assets, go to meshes, and in here in fighter jet just
find the skeleton. It says skeleton on it. I will click on it to open it. In here, let me collapse this
one and in our **** joint, you can see if we have some
hard point already there. You can see the
positioning of them. That looks good, right? We can test them out to see if it looks good, but
right click on it, add preview asset and choose
or skeletoms you can see, No, we have one in there. Again, we have
another hard point. We have R 0.1, two, three, four, in our Chassis of our
fighter jet, right? Again, right click, go to add preview acid and choose the one that you want
to put in there. Now, you can see, we
have another one. But we don't want
to do it like this. We can just right, click on it, remove all attached assets. How we want to do
it, we want to use the hard point to put some missiles on the fuselage
of our fighter jet, right? So for doing that, we need skeletal mesh inside
over components in here. So click on the
mesh and click on AD and search for skeletal mesh. This first one, I want to
call it missile zero, one. Okay. Control D to duplicate it. That's good. Again, Control D to duplicate it one more time. Again, control D to
duplicate it one more time. And hold shift and select the other ones as well
in here or either holding Control and selecting them and choose a skeletal mesh. In this case, we want
to use our missile. Now, you can see all the
missiles are down here. That doesn't look good. We can just click on the missiles because it
is child of the mesh, we can choose a parent socket. So in here, click on it. I want to put it on Hard 0.1. No, you can see this at the
right place. That's good. Missile two, again, click on it, go to parent socket, and I want to put it
on HardPoint two. Now, you can see it.
That looks good, right? Missile three, we
want to put it at HardPointT can see it. And again, missile four, I want to put a socket
there, Hard 0.4. Now with that, let's just
compile save and Runo game. You can see we have some
missiles in our game. We can just go forward. Let's just look at it right
and go up. Close the gears. That's good. Now we have some
missiles that we can shoot. That looks good. Let's see how we can shoot them.
42. 40 Missile Reload system: No, we have some missiles
on the hard point. But right now, we
can't fire them. I want to go step by
step for creating this missile system so you
will understand it better. We start with the input. So let's just go to content
drawer in here, go to input, right click in here
and go to input, create input action, and I
want to call it IA fire, okay? You don't need to change
anything inside it. The digital boolean
is more than enough. You can just save
it and close it. And now we need to map it
in IMC fighter yet, right? Add the mapping in here, go down, so we find
the empty one. So click on it, Ifire and again, let's just
go down, AFire in here. Whenever we hit Leftmost button, we want to fire, right? So let's see how we can use it. If we go to blueprint, I want to close some of these. We don't need them. Just a went graph is
more than enough. Down here, what I want to do, I want to rightly search
for IA fire, right? So what we want to
happen whenever we press the leftmost button, this started will happen. There is a couple of ways
that we can do this, but what I want to do, I don't want to create arrays, I don't want to create
any more variable. I want to use just this
component that we have in here. For example, I want to check
the missile visibility. You can see there
is a visible there. So what we can do with that, whenever we had leftmost button, we want to check which
one of these are visible. If it is visible,
we can fire it. And after we fire it, we make it invisible, and after, for example, two second, we make them visible again, right, like any AC combat game. So let's see how we
can do. In here, I want to get the missile one. We want to get the visible
get visible of it. Okay? This visible is exactly the visible
that we have in here. Let me show it to you. If you go down, you
can see visible. We are getting that
and we are using that visible boolean inside each one of these missile to check
if we shoot them or not. So we want to check
this with the branch. If it is visible, if we hit leftmost button and the missile one was visible, this true will happen, and we can use a printer string. And I want to say, fire
missile one, fire missile one. After that, we want to change the visibility of
this missile one. So we can copy and
paste this missile one or get it from here by
dragging and dropping it. And in here, we can say set visibility for our missile one. We don't need the
new sense that it's automatically
creating here because we drag and drop
and put it there, and we make the new
visibility to false, right? Now, with that done, we
need to create a timer. So tell it after 2 seconds, be reloaded, right, so
we can fire it again. So how we can do that, we
can drag and drop in here. We can say set timer
by event, right? And the event, I can drag and drop and create a custom event for that and I want to call
it missile one, reload. Okay. And whenever
after 2 seconds, let's just put two in here. After 2 seconds, we want to
change back the visibility. We can just copy and
paste these notes to here and change the
visibility to true. We did that for missile one. Let's just check that out.
If you run over game, you can see the missile one, it's at the right wing. If I have leftmost button, no, you can see it is invisible
and after 2 seconds, it will be visible again. If we have leftmost
button again, you can see it says
fire missile one, and we can shoot it and it will be reloaded
after 2 seconds. So no, we are making one of the missiles invisible
and after 2 seconds, we make it visible. No, let's see how we can do
it for the other missiles. If the missile one
was not visible, it means we shoot
it before, right? So this false will happen, and we want to do all of these for the other
missiles as well. I want you to do that so we can shoot other
missiles as well, missile two, three, and four, and we will do it next
video together as.
43. 41 Other Missile Done: No for doing it for
the other ones. If the missile one
was not visible, it means we did shoot it. We did make it invisible, and we should wait 2 seconds to be able to
shoot it again, right? So, in case of falls,
what I want to do, I want to get the missile to, and in here, again, search for visibility,
get the visible, right? And again, check it with a branch like this.
Use a branch. And if the missile
two was visible, we want to do all
of these again. So let's just copy everything
from here to here, right? And we need to make
some space in here, here, we have some space, right? This is for missile two. So if the missile
two was visible, this true will happen, and we can say we fire
missile two, right? And after that, we want to
make the new visibility of missile two to
not be visible. So connect the
missile two to here. Now, after that, there will be an event and it needs
a custom event, and I want to call it
reload, missile 02. That's it. And now we want
to change the visibility of missile two to
two after 2 seconds. Now, let's see what will happen. If I compile and run, you can see if I head
leftmost two time, you can see two of the
missiles gone and after that, it will be reloaded. That looks good,
right? It's optimized. It's a good thing to do,
so don't worry about it. We could just do it with arrays, but we are complicating
stuff with arrays, so we don't need it, right? We need to do it for Missile three and Missile four, as well. And how we can do that,
again, exactly like before, I want to this time
copy everything, copy and paste it down here. And connect the falls of this
one to branch of this one. Just change them wherever
there is missile two. You want to change it to
missile three. That's it. Now, in here, you want
to shoot missile three, so we say missile three. Again, we want to change
the visibility of missile three to
falls like this, and it needs a custom event, we can just call it reload. Missile tree, right? And again, in here, we want to
set the visibility to two after 2 seconds
for missile tree. Connect the missile
tree in here. That's good. Now, let's just
do it for missile four. Control C, Control V
to paste everything, and case of falls, we connected to this branch. We need to change the missile
tree to missile four. Again, we want to do
it for here as well. We say four, and missile three, two, missile four in
here, custom event, you want to change it to reload, missile four, we need to
change this missile three, two, missile four. That's it. Now, let's just test that out. If you run over game, you
can see leftmost button, and we are shooting
all of the missiles. You can see that you
do it really fast. After 2 seconds, all of them
will be shoot it, right? So now, we are making the visibility of our
missiles correctly, and we are shooting them one
by one after each other. But the problem is that we
are not shooting anything. We are just changing the
visibility of a skeletal mache. Now, let's see how we can create an actual missile that we can
shoot it to shoot something
44. 42 Missile blueprint: Till now what we have done, we are just making missile disappear whenever
we hit leftmost bottom, but there is no missiles. We can't hit anything, right? So this is the time to
create the actual missile. For doing that, I want
to go to Content drawer, go to Blueprint folder in
fighter jet, and in here, right click and create a blueprint class
of type of actor. That's more than enough.
I want to call it BP missile. That's it. D'll click on it to open
it inside this blueprint. First, we need a skeletal mesh. So let's just click on AD
and add a skeletal mesh. I want to put this skeletal
mesh as default scene root, so everything will be based
on this skeletal mesh. Now, click on the
skeletal mesh and choose the SK for skeleton
with missile 26. Choose it. Now, you
can see it over here. That's it. If you hit compile, save and go to level,
we can put it there. This is where fighter jet will spawn and I want to add this
missile to here, right? What I want to do,
I want to rotate at 180 degree around the Z axis, so it will face forward like
our fighter Jet, right? Now, if you run over game, you can see the
missile is there. I want to bring it up a little bit so it don't hit
the ground, right? Again, let's just run over
game and you can see, there is a missile in the sky. It's not moving. Let's see
how we can make it move. If you go to our BP Missile, we can click on Add and search for projectile
movement component. This is like any component
that we have used, like character movement, like vehicle movement component
and all of that. And it gives us lots of options. For example, the
initializer speed that I want to put
it on 1,000, right? And the Max speed, I
want to put it on 2000. You decide what you want to do. Can see we can see it because it's going
under the ground. Why it's going under
the ground Because or missile speed is not a lot. So let's just add zero
to it for two of them. Initialized speed and max
speed to 10,020 thousand. Now, let's just compile
and go to a level and run. Again, we can see it. The better way to see
this kind of stuff is by adding no graphics
to it, smoke, right? But for now, let me
show you another way. If you go to our blueprint, go back at the back of our
missile and head simulate No, you can see it's working, right? Again, we can click on Simulate and you can
see it's working. But the problem is inside our level when we run
it, we can see it. It's going too fast, right? So for you to see it better, I want to start this
simulation and I want to add a Niagara eff. So click on skeletal mesh at a Niagara system Niagara
particle system component, and I want it to be as a child of a skeletal
mesh. This is important. After that, choose
NS west Missile 26, the Niagara effic for this
missile. Click on it. Now, you can see we
have some effet. But the problem with that is that it's facing the wrong way. If you click on
our Nagar system, we can make it as a
child of a socket, and there is a socket on
this skeletal mesh that is called root joint socket. If you choose that, no, you can see it is at the right place. This skeletal mese has bones, and there is sockets
there that we can put something there, right? If we had compile save and know if we run
over game over here, no, you can see it better. Next thing that I want to do inside this projectile movement, there is option for rotation
follows the velocity. So at some point, this missile can turn around and it doesn't know
where to go, right? It doesn't know where
it should point at. With this option rotation
follows velocity, we make sure that it
always pay forward. Nothing you will see in here, but it will fix lots
of problem in future. Now with that, we have a missile for you
to see it better. What I want to do
I want to go to a level and rotated
a little bit, so it go forward like this. Now, if you run over game, no, you can see it better. It's go up and after that, it will go down. That's it. Now the next thing that
you want to add to it, we want to add some sound. Let's see how we
can do that. Next
45. 43 Missile meta sound: No, for the sound. We want to use metasund
because it gives us lots of options to actually be playing right sound
at the right time. So for doing that, I want
to go to Content drawer, and if you go to Fighter
Jet Assets Sounds, you can see there are
some sounds in here. We did use jet engine before, but I want to use
these two sound. First of all, there is
rocket MP tree, this one. If you play it. This is for the
start of the sound. And after that, the
missile is far away. We want to play
this one. This one. Can you hear it? So
at the beginning, we play this and after
that, we play this one. For doing that, I want to go to Sounds folder in fighter jet, Sounds folder, and
right click in here, go to audio and create
metasund source. I want to call it s
for metasund Missile. Okay? I'll click
on it to open it. And in here, first, I want to create a wave player. This time, I want to use stereo, right? You can do that. And know what will happen, it will give us a Olift and out. But at the output, we have just Omano, right? How we can change this metasund
from mono to a stereo, you can just go to metasund
in here and change the output format
from mono to stereo. Now we have Oleft and out right. Okay. So first thing first,
what we want to play, we want to play the rocket
MPT, this one, right? The one that will start. That's it. Let's
just click on it. It will play it for us because
it is connected to n play. So no just with that, if you connect these 20 left
and out right and we play, see it will play
the sound for us, and after that, it gets finished and everything
will be finished, right? But after this one is finished, we want to play another sound. But how we can play that we can add another
wave player, right? Wave player of type
of stereo this time, I want to choose the
rocket engine. That's it. And the problem is we can't connect these two
together, right? We need to mix these two. How we can do that,
we can use a mixer. Let's just search
for mixer because the type of audio
is mixer a stereo, we choose a stereo mixer. That's it. No, we can connect the out left
to the left of this, out right to right of this, and mix these two together. This node will do that for us. No, connected like this. No, if you run, You see, both of them are playing. You can see it of course here. After that, this will be there. But the problem again, is that both of them
are playing together. This one, we wanted to
wait for some second. And after that,
get to be played. How we can do that,
if you drag and drop from here and
search for delay, there is a trig delay
note that we can use. After 1 second, we wanted
to play this one, right? So now, let's just play. If we hit play, the first, this one will be played. After 1 second, this
one will be played. You can just look at these lines to understand
which one is playing first. Head, run, first,
and after that, this one will be played. Again, these lines, we
show it to you as well. After 1 second, one. See it? So now, we have a meta
sound that we can use. And another thing that
I want to do this one, the start of the engine, I don't want it to be on loop. I want it to be
played just once. But this one I want
it to continuously be played until the
rocket reach something. So we put it on loop like
this by just checking this. No, with that done we
can add it to missile. For doing that, I want
to go to BP Missile, and in here, click on skeletal
mesh at a audio, right? We have audio in
here that because we choose the MS
missile in here, it will choose it
automatically there. But if you deselect
it and hit at, we have just audio. Click on audio to add the audio, and in here, we can
choose the sound. The sound that we
use is MS Missile, the meta sound that
we create together. Now, if you hit compile save and go to over level and run, see how beautiful it is. But you will hear a problem. If you run again, and see it can shoot and
it will go away. But the sound volume is
not decreasing at all. It's like it's
close to us, right? That's why we want to use
attenuation for over sound. Let's see how we
can do that next
46. 44 Missile sound attenuation: Right now the problem with our sound is that
when they play it, if it gets farther away from
us, again, we can't hear it. It's like it's close to us. That's why we need to
create a attenuation. I want to go to
content drawer in sounds folder in fighter folder. On the right click, go
to audio and in here, create a sound attenuation. I want to call it SA
for sound attenuation, and I want to call it missile. I'll click on it to open it. And in here, there are some options that they
want to change. For example, in a radius,
what does it mean? If you hover over it, it will the radius that defines when
the sound attenuation begin. So right now for four meter, we can hear it
completely, right? And after that, it
will start decading. The volume will decrease, right? Again, there is a
fall of distance, the distance over which volume
attenuation occurs, right? So no just with these default values,
let's just put it there. If you go to our BP
Missile, go to audio, if you go down, we
have attenuation setting that we can put
it there as a missile. No, you can see there
is an inner circle that you can see it in here that if you are inside
that inner circle, we can hear it completely. But after that, it will
start decreasing its volume. Now, let's just run over
game to test it. That's it. We can't hear it at all. Why? Because where
sound attenuation, sphere is too small. So let's just increase
that to 10,000, for example, for this one, and 80,000 for this one, right? So we can hear it completely. If we again, go to
BP Missile, no, you can see when we are
close to it, we can hear it, and farther away from us, we can't hear it anymore. So no runway. No, you can see the sound is
decreasing and decreasing. And it's not destroyed. It's going forward and forward. You can see, no, you
can't hear it at all. You can hear the jet engine, but you can't hear
the missiles again. Let me run it again. At the beginning,
we can hear it, but after some time, we
can't hear it anymore. That was for sound attenuation that we needed for a missile.
47. 45 Missile explosion: No, or missile can go forward, but it can't hit anything. So let's just run. You can see it's going up
and hitting the ground, but it didn't get destroyed
or hitting anything, right? So for doing that, I
want to go to BP Mest. First thing that I
want to do in here, I want to click on the Skeletal
mesh, go to collision. Let me find the collision. After physics and animation rig, we want to go to collision. And in here, right now, there is no collision. We want to change
that so it will collide with something with
the ground, for example. The only thing that I don't want this to have collision
with is the pawn. So I will say, ignore
only the pawn. So choose Ignore only the pwd. Now, if you run over game, he's growing up and it will hit the ground and you can
see it will stay there. We can go to So leave. Go down, go down.
No, you can see it. It will stop there, right? So when it collides
with something, it will stop, but that's
not enough for us. We want to have some explosion. For doing that, go
to event graph, and in here, we have a couple
of things that we can do. In this projectile movement, there is a event that is
called Unprojectile Stop. When it hits something,
it will stop. So click on Unprojectile
Stop plus in here, so it will create that for us. Let's just test it with
the print test ring. And that's it. Say hello, right? If it should, you can see when it hit the ground,
it says, Hello. I don't want to say the
hello, what I want to do. I want to spa explosion.
What explosion? Let me go to Content drawer
in VFX, go to prefabs. And in here, we
have augur system that is just a explosion. Let it compile and it
will show it to you. You can see this is the explosion that we
want to use, right? So let's see how we can use it. Close it. You don't need it. We can just go to or BP Missa
on projectile stop in here. We can say spawn system
at location, right? So this spawn
system at location, we can tell it to spawn
the dust explosion, right? The no graphic that
we had, right? Just with that licious compile. Now, if you run over
there, you can see, when it hit the ground, if you add explosion, but it's doing it at the bit of our fighter jet, and
that's not good. How we can change the location. We have a location in here. There we can say
get actor location, so get the location of the
missile when it stops. So let's just do that.
Get actor location. That's it. No, let's
just test that or tip it runs wait I had, and there is explosion
there. Cool, right? But I don't want to
do it like this. There is an impact
result that we can break it and use its stuff. For example, the impact point. So let's just choose the impact point for our
location. And that's it. If you run over game you
see when it hit the ground, we have an explosion and
you can see it good, right? But another problem that we have that it's not
destroying after that. So we need to add a destroy
node in here. Destroy actor. No, let's just compile
and run over game. I will shoot create a explosion, and after that, it
will be destroyed. Next thing that
you want to do we want to play some
explosion sound. So let's see how we can do that. For doing that, before
destroying this actor, I want to say span sound
at location, right? We have the location over here. We can just connect it
like this to the location, and the sound that I want to use is called ES Generate Explosion. That's good. Generate
explosion, right? Let's just compile and run. So you can see if you go forward and it hit
the ground and now you can see there is a
explosion sound as well. Let's just test that time. Y, and when it hit the ground, there is explosion
sound. That's good. So no over missile can be fired and it can have some explosion
when it hits something. Now, let's see how we
can actually use it.
48. 46 Shoot missiles: No for using it. It's actually easy. Let's just go to our BPF 18 when we release the first missile. For example, missile one. Let's just go here. When we set the visibility
of our missile one to falls before reloading it before actually start the
timer for reloading it, I want to spawn a W missile. We can just say spawn
actor from a class. You know that the or BP missile
is just an actor, right? So we can spawn it. So the class that you want to
spawn is called BP missile. That's it. It needs a transform. So how we can get the transform. We can get our missile and get the word transform
off of it, right? Because we are
shooting missile one in here, the missile one. That's why we get
the word transform of missile one and we tell
it to spawn it from there. No, it's expand this,
there are some options. For example, collision handling override. I want
to click in here. I want to change this to try to adjust location,
but always span. So whenever we hit
Leftmost button, it will be fired always. And that's all we need to do. Now with that, let's
just had Compile, save and go to our
level and delete this missile because we want
to do it automatically. Now, if you run over game, you can see look at
the missile one. If I hit leftmost button, you can see, no it's working
and it's reloading as well. Again, let's just shoot it. Cool. Let's just
go into the sky. Shoot. And then you can see the missile, I
will hit the ground. Let's just close
of the gears and go back and shoot
or missile one. See it, it should be destroyed. Again, in this estate, we can go up and
shoot or missile. And let's just test
it one more time. Shoot good, right? The plane is not destroyed because we are not
finished with it, right? Two n, and working fine. No, it's time to add this missile to other
missiles as well. We have missile two, three, four, and all of that, right? We should do it for all of
them. We need some space. So let's just grab all of these, create some space over here. This is for missile four. This is for missile three. Of course, I did
say that you could just use a array in here, but because we have
just four missile, I didn't want to make
things complicated. That's why I'm using this, right? So that's good. Now, let's just copy this and
paste it everywhere, right? We need some space over here, paste it for this
one, like this. And the only thing that
we need to change is this getting word transformed from missile two because this
is for missile two. Let's just do it for this one. Again, Control V
to paste it over here and connect
the execution pin, connect the execution
pin to here, and Missile three, right? So connect missile
three here. That's it. Again, create some
space over here, control V to paste it over here. And connect the execution
pin to here and here, and this one is for missile four. Now,
let's just test that. If you're on, we're
game. Left most button, left most button, button,
left mouse button. You can see it will
reload as well. We should go forward
a little bit. Go into the spot. Now we can shoot all
of our missiles.
49. 47 Kill camera: Now I want to make our game a
little bit more interesting with adding a camera as a
kill camera to our missile. Let's see how we can do that. For doing that
inside our missile, I want to click on
the skeletal mesh, add the spring arm like
we did for our fighter. After that, click
on a spring arm, add the camera to it, right? Search for camera and
add the camera there. Now, you can see the
camera where it is. I want to position it somewhere
so we can see it better. For doing that, I want to
click on or a spring arm. I want to change the target
arm length to 850 like this. So we can see the
camera actually. After that, I want to add
some offset, for example, offset to the X positive, 230. Okay. And for the Y 150, I detest all of this stuff, so you can see it better. So it will look
much more better, but you can put the camera wherever you want. You
can put it over here. You can put it back
wherever you want, you can put it there,
right? Just test with it. Now, we have a camera
inside or missile. Let's just compile, save. I want to put it over here. No, I want to go to BPF 18. There is a node for switching
between the camera. By default, the camera
that our game is using is this camera
inside or BPF 18. We can switch that, right? So in here, we create our missile and there
is a camera inside or missile on a set the
viewport to that camera. How we can do that.
There is a node that is called set view Target. And with searching
that nothing comes up, you should disable this
context sensitive. And no, if you go down, we have a set view target
with blend, right? This is the node that we want. Let me create some
more space in here. This is for Missile four. So will do it for
other ones as well. First, it needs the controller. The target should be
player controller. If you have overt,
it will tell you. So with that, we can say get
player controller, right? That's it. And the
new view target, we can just pass the BP missile that we
spawn in here, okay? We spawn it in
here, Missile four. And we need to add a blend time, so it will smoothly go
to that new camera. For example, I want
to put it to two. There are some blend function. What I want to use, I want
to use is in out, right? You can try other
things as well. The blend exponent,
if you hover over it, it says use by certain
blend function to control the
shape of the curve. So for example, this is in out
needs this blend exponent. I want to put five in there, but again, you can try
other stuff as well. Know what will happen
if you compile, save and run or game
for testing that. Let's just go into the sky
so you can see it better. The first one, if
you shoot it happen, but the 41, the
miside far you can see the camera is
changing to that missile. Now, let's just test it
one more time in here. I want to go to the sky. I want to go forward
and go back. So what I want to do, I want to go and
decrease the throttle. No, I want to hit left
moves button four. You can see the for inside we have the camera
you can see how be. Let's see until you get
something, and it's beautiful. And it is destroyed, you can see it
down there, right? So we have a camera inside or BP mess that we can
switch to it, right? We should do it for
other ones as well. We can just control C
to copy it and control we to paste it over
here, right, like this. And like this, we want to do
it for this one, as well. Again, control V to
paste it over here, connect the execution pin. Make sure you connect the
return value of this spawn, actor BP missile to
the new view target, and we should do it
for this one as well. We have just one other
one to add in here. Control V to paste it over here. Now, we need to connect this. I need the execution
pin in here and here. Now if you run again, we can test it better now. So going forward,
and you see that looks useful and it
did Explode as well. Let's just shoot
this way. Shoot. You see? The plane is going up, you can and you can
see it will go up. It has an arch. After that, you start going down. I see if it hit
the ground or not. So that's it, we have
a camera that make our game very much
more beautiful.
50. 48 Missile rotation: No over me size look good, but I want to make it better. H I want it to rotate
it when it's moving, right? Let's see
how we can do that. For doing that, you know, that I want to rotate
it around the X axis. You can see in this direction, I want it to rotate like this. So it looks more like
a real missile, right? For doing that, there is
lots of ways to do it, but I want to do it with
animation blueprint. Because this missile is
just another skeletal mesh, we can animate it
as well, right? So if you click on
a skeletal Image, we can decide the
anim class for that. So let's just create a animation blueprint
for our missile. So let's just go here in
fighter jet Blueprint, right click in here, go to animation and create
animation blueprint. It will tell you
which skeleton you want to create animation
blueprint for, we want to do it for
over missile, select it, head create and I want
to call it ABP Missile. Okay. Don't click on it to open it first thing that
you want to do in here. We want to search
for mesh space, f pose, so it will give us all the information
about the bones. After that, I want to
use Modify Bone, right. And after that, we can just
connect it to OtwoodPose. With this modify bone, we want to rotate over Missi. We did that before, right?
So first thing first, we need to choose
the bone to modify. Click in here. The
bone that I want to modify is called a skeleton GRP, skeleton group,
right? So selected. And next thing, we don't want
to change the translation. So I will click in here. Don't expose it as pin, right. We want to do it for
the scale as well. We don't want to
change the scale, so don't expose it as pin. But for the rotation, we wanted to add it to
existence, and that's it. We can now modify the bone. Right click in here,
split a stroke pin, so we can just change the role. For example, if I
had compile and put ten in here at head compile, you can see it did rotate. If I put 20 in here and
head compile, again, you can see it's rotating
right so if you put 360, it will rotate one
completely, right? That's it. I want to
put zero in here. I want to do it with a variable. So in here, let's just
create a variable. I want to call it rotation. That's it. And the type, I want it to be a float, and
I want to get it over here. And with that, let's
just connect it to rotation eggs right, headcmpile and with that, let's just test the toad, right? If we increase it,
you can see it's rotating with this variable, but I don't want to change this variable too much
to see effect in here. That's why I want to
multiply this by some value, for example, 1,000, right, and connect it to here. Why I'm doing that because this float variable has a limitation. We want to be able
to change this value a little bit and see lots
of effects on the rotation. So for example, if I put 0.1
in here and head compile, you can see it's moving
with just changing to 0.1. After that 0.2,
something will happen. You can see you don't need to change it too much to
see effect, right? But if you connect
it directly to rotation, what will happen, you need to change
this rotation variable a lot so you can see
the rotation, right? So that said know where we
want to change this rotation. We want to change it
inside or BP missile. But before doing that, we
need to click on or skeletal mesh and put or anim class
that we create to here, a BP missile. So put it there. Now I want to go to event graph, and in event Tov here, want to create a variable. And I can just call
it rotation, right? And the type, as you know,
I want it to be a float. And in here, we
want to change it. So what I want to do, I want to get this rotation, add to it by Delta second, it will be a small value, right, and save it
inside rotation again. So set the rotation
with this new value. So each frame this
rotation variable will be increased a little
bit by milliseconds, right? So let's just head compile, save and go to our ABP missile. And in event graph of here, we want to get that value. So first and first, I want to create a begin play in here, begin play, event
blueprint begin play. And with that, we want to
cast this to BP Missile, but it can't find it. Why? Because this one doesn't work with actor classes because BP Missile
is just an actor. It's not a pawn, right? So that's why this
node won't work, but there is a node for
this kid owning actor. We know that the owner of this animation blueprint
is BP Missile. We use it in BP Missile in here, and the type of it is actor. So that's why we need
to use get on in actor, and with that, we can
cast this to BP Missile. That's it, which is
connected to execution pin. We can right click on this one, promoted to a variable,
and that's it. We can name it something better. For example, just BP Missile. That's no, we can
get the values from this BP missile in our
update animation, right? So in here, we can get the
rotation, get the rotation. And again, we can set the
rotation that is here with the value that we get from our BP missile like
this, every frame. That's it. No, let's just
test that I we run over game. No, let's just go up. So
you can see it better. If I hit leftmost button, no. You see, it's rotating and
that looks beautiful, right? Look at this. That
looks beautiful. But one problem that
we have in here, if I hit leftmost button, the camera will go to
the mi side and it will stay there and that
doesn't look good. It will continuously be there. So we need to find a way to cancel load this camera
switching, right? But see we can do that next
51. 49 Track camera cancelation: One problem that
we had was this. Whenever we switch the camera, it will stay at the missile
until it hits something. But what if our missile doesn't hit anything?
What should happen? We need to find a way to
do this kind of stuff to manually change
the camera back to over fighter jet.
How we can do that. You can find your own way,
but what I want to do. I want to say, if the player
hold leftmost button, just switch the camera
and track the missile. But if they release
the leftmost button, go back to default camera
that is in our fighter jet. So how we can do that
where we are firing the missiles with IIFre and we have started
and we have completed. Whenever we release
the leftmost button, this completed will happen, and with that, we can change
the view target, right? How we are changing the camera, we are changing
it like this with these two notes let's
just use control, see control, to
paste it over here. With set view target, we blend whenever we release
the leftmost button, and I don't want to blend it. I want to just put it at zero, so it will instantly
happen, right? And again, this blend function won't happen because
the blend time is zero. That's it. But what is
the new view target? We want it to be
over fighter jet, so we can just use self, create reference for self. That's it. Now, let's just
head compile, save and run. I go forward, go to the sky. And if I hit left mouse button on our
keyboard and hold it, you can see it's
going to that camera. But if you release
left mouse button, you can go back to our fighter. Again, if I hit left mouse
button just once, you can see, it's working, but
we are not going to that missile anymore, right? So go back. Again, I want
to test that one more time. Shoot. I didn't hold it,
but this time let's just hold it to see
what will happen. You can see, I did hold it, and after that release it,
everything's working fine. Again, if I hold it here, until I'm holding it, you can see everything
should work fine. And after you hit the ground, if you change the camera automatiue Everything
looks good. Should go to the next topic.
52. 50 Target class: No, our missiles works
good and looks good, but we want to be
able to hit a target. If our missile just go
forward, it doesn't look good. It needs to go to the target. It needs to lock on a target and hit it
like any fighter jet. Let's see how we can do that. For doing that, first of all, I want to create a target. So I want to right click in here and fighter
jet Blueprint folder, create a blueprint
class of type of actor, and I want to call it BP. Target. It doesn't
need to be just this. The important thing
about this PP target, if you go to the class default, you can go down in advance. In the tags, we can add a tag
in here and call it target. So whatever blueprint
that you have, if you go to the
class default and add a tag that is called target, we can target it
in future, right? So that's it. Now what this
we want it to look like. Let's just head
at a static Mish, for example, I want to put
it as default syn root. And in here, let's just
choose a estatic machine. Right now, there is no
estatic machine here. We can just click in here, and we can tell it to show
the engine content as well, so we can choose
something in here, right? So let me go down. I want to search for a cube. It is in the engine as well. So choose a cube and
you can see it in here. You can put whatever
you want in here. The important thing with
this is that you go to class default and in actor in advance of
that actor category, go to tags, add tag
and call it target. With that, we target
the stuff, right. So no with that, I want
to go to event graph. I want this static
image to be hittable. So that's why I want
to go to collision, and I want to tell
it to simulate generate hit event, right? Just check that and tell
it to block all dynamic. By default, it is that, right? So we can hit it and it will
generate a hit event, right? After that, just go down
and we have component hit. If something hit
this estatic mesh, we want it to destroy it, right? For example, if the missile
hit this estatic mesh, we want to destroy
this class completely. With that, everything is done. The BP target is
more than enough. Let's just go to Viewport. And in here, let's
just put one of them in here in
here, for example. Go to here BP Target. We want to put it over here. Let's bring it up. Of course, from far away, we can
see it, but that's okay. Now we have a target
that we can lock on it. Let's see how we can actually
log on a target next.
53. 51 homing missile: No, we have a target. Let's see how we can use our missile to
shoot at it, right? One way is to line up the
shot and fire the missile. But the actual missile on any fighter jet,
it's not like that. It will track the target, and it will lock on it
and it will hit it, right? That's what
we want to do. And inside our BP missile,
we have that option. If you click on
projectile movement, there is an option that is
called Homing projectile, homing category that
we can use it to tell it which target to track, to lock on to go after, right? So enable this, and there is a homing acceleration magnitude that if you increase
this to a bigger value, it means our missile can maneuver a lot to
hit the target. So you don't want to
increase this a lot. But you should test with it. I want to test it
with 100,000, right? And let's just compile. No, this homing missile
needs a target to shoot at, and how we can set that, if we get the projectile
movement component in here, there is a home in missile. If we search for homing missile, we can set homing
target component. We can tell it what is your target with this node that is inside or
projectile movement, right? But what is this? It is if you hover over it, it is SN component, right? So we need to put a SN
component as a target. I need execution
and pin as well. How we can do that,
I can just create a variable and I want
to call it target. Okay. And the type of it,
I want it to be actor. So search for actor, choose an actor in
here, object reference. And what I want to do I
want this to be instance editable and expose on a span so we can set
it everywhere, right? Now with this target
variable that we can set later, don't
worry about it. But for no, we get the target. And because these need
a scene component, we can tell it, get the
scene component of it. We get component by class. And the component class, as you can guess it, is a scene component. So get me this target
as a scene component, so I can use it with a target
homing missiles, right? So that's it if you
hit compile, save. And no, let's just go to level and we have
a target there. Let's just go to content drawer. Now, let's just go to players
starting here, go here, because we want to see it, I don't know where
is the BP target. Let's just look at it. No, it is at the here. You can see the
plane will be here, and the target will be there. Now, let's just add or missile
again, just like this. We want to rotate
at 180 degrees, so let's just do that and we want to bring it
up a little bit. No, if you run our
game, go forward. You can see nothing happened and it will give us
some errors, right? So don't worry about the
errors. We will fix it. But no with selecting
our missile, there is a target variable. This target variable is exactly this target variable
that we have in here, and we did use it for our homing target component,
homing missile, right? So it knows where to
target at, right? So because we click on the target tell it to be insensittable and
expose on a span, that's why we have
access to it in here. No, let's just choose over
BP Target as a target. So in here, let's just put
the BP target over here, no, it has a target. Let's just run over game. So you can see it
did go that way until it hit the target, the BP target that
we put in there. You can see it give us some errors because the
missile is destroyed, the target is destroyed
when we hit it, right? That's why it gives
us some errors. And for fixing those,
whenever you get something from other blueprint
or outside of a blueprint, you need to check it
if it's valid or not. For example, this
target variable, we are setting it outside the
blueprint in here, right? So to be safe, we check if it is valid. So we check if it is
valid, is valid, right? If it is valid, we can set it as homing target,
right? That's it. And we want to do the same
inside or ABP missile. When we get the
rotation, right, first, we want to check if this
BP missile is valid, okay? Because you are getting it
outside of this blueprint. So we need to check
if it is valid. And that will fix all
the errors and bugs. No, let's just run again. It is going away, and
it will hit the target. And if you close the game, there is no errors anymore.
54. 52 Targetting system: No, for a targeting system, what I want to do I want
to use a box collision. So with that box collision, I want to see what is at the front of a fighter
jet for doing that. Let's just go and
click on or mesh, add and search for box,
the box collision. And if you go to
Viewport, you can see it. It is a small down here. I want to change the
box and extend to 50,000 by 50,000
by 50,000, right? That's it. And I
want to bring it in its direction forward by
50,000 as well, like this. So it will see whatever that this fighter jet
sees in front of it. And you can tell it
to not be visible. That's it. We know it is there because it is a really big box. I want to make it invisible, not visible, so it will
be easier to work with. No, with that, I want
to go to Event graph, click on the box and go
down in here until we reach the component begin overlap in here, what
do you want to do? Let me bring it down over here. We want to check
if the other actor has tag that it says in it, Target, it is a target, you can log on it,
right? So let's see. We can drag and draw from this other actor that begin overlap with
this box collision. And we can say if the
actor has tag of target. So put target in here, can check with the
branch with the branch. And if it is true, it means it is a valid target and we can save it
somewhere, right? So we can just right click on this one and promote it
to a variable, right? The type is actor and I
want to call it target. Target that this plane have. And we want to save it
in case this actor, this other actor has the
tag of target. That's it. Know with that done,
how we can tell the missile that we are shooting that this
is your target. How we can do that, we go up, for example, missile one. Let me bring all of these
to the right like this. And in here, no, if you go
to spawn Actor BP Missile, you can see there is new
input that is called target. This target input is exactly this target valuable that we create over here in
our missile, right? It did show it to
us in here, right? So we can set it with
this target, right? We want to do it
for the other ones as well. All of them has this. So get the target
connected to this target, and we want to do it
for missile T as well. Target, connected to the target. So we pass the target
that we find with airbox collision
to the BP missile. So the BP missile knows
what is the target, right? So let's just pass
it to all of them. Now, if we had compile, save and Runo game, there is a target there. I should if you hit left
most button, you can see? No, it is going there
and it will destroy it. After that, we don't
have any target, so it can go forward, right? But right now, if
you play our game, you can see there
is no indicator that there is a
target there, right? But if you hit leftmost button it is going to that
target. That's good. But we need indicator, and we want to use
a UI for that. Let's see how we can create
a target indicator UI.
55. 53 Targeting system UI: No we are targeting a
target, tracking a target, and hitting a
target, but there is no UI for indicating what
we are targeting, right? So for doing that,
what I want to do, I want to go to Content drawer, go to Widgets folder inside
the fighter jet folder, right click, go to user interface in here and
create a widget blueprint. And I want to create a
type of user widget, right on call a WBP AM. Or whatever you want to call it. I'll click on it to open it. In here, the only thing that I want to add is just a border. So dragon drop a border in
here and you can see it. First thing first,
the alignment, I want it to be at
middle like this. For you to see it better, I don't want it to fill up the screen. It's
just for showing. I want to put it on
desire. You can see it. Now it's small like this. Well change it in
we blueprint later. Next thing, I don't
want it to be image. I want it to be at
just a border, right? Just a border I want the margin for all direction
to be one like this. Just put one in there. Right, left, bottom, all of
them, we want it to be one. It should automatically
put all of them in one when we
put one in here, but go there and do that. In brush color, I want to put
it on green like As combat. It is green, right?
Put it on green. And that's all we
need to do for here. Now, let's just see
how we can use it. If you go to BPF 18, click on the mesh at
a Widget Blueprint, right? Search for Widget. That's it. The widget that
we want to use getClass, we want to set it to WBPA. And the space I want
it to be a screen. So it will always be on screen, not behind some
walls or whatever. And no, the size of it, I want it to be 100 by 100. This is where we decide
the size of that border. Now with that widget there, if you run over game, you can see there is
a green box there. You can see it? No, we want
to change the position of that green box or green
square to the target. Let's see how we can do
that. For doing that, I want to find the eventiq
where is it in here, right? And what I want to
do because I need lots of space with
this eventiqu, I want to put it
up here like this. And after this, I want to
create a sequence node, so I have multiple execution
pin on execution zero, what I want to do,
I want to check if this target that
we find was valid, so we check it which is valid. If it was valid, it need execution pin. So let's just put it there. We want to get this widget like this and set the
word location on. It set word location. To the location of this target. So again, let's just
get the target and get actor location and connected
to this location, right? That's it. Now if we head compile and save
and run over game, no, you can see it. The position of our widget
is to detour target. Let's just hit it,
right? See? No, you will see one problem. When it gets destroyed, again, the position
is not changing. It is changing with fighter jet, but it shouldn't feel like that. Let me test it one more time. Right now, whatever we
change our fighter jet, we move it or whatever, the position will be the same. And if you shoot it,
when it's destroyed, if you stay there, you can
see that doesn't look good. So what we want to do we want to check if the target
is not valid anymore, we want to set the visibility
of this widget to falls. Or we can do that. We get
the widget and we say set visibility to false if
the target is not valid. But if the target is valid, we need to again set it to true. Control C control V
to paste it over here and set the visibility
of our widget to true. So in case the target is valid, we set the position of our widget and we tell
it to be visible. But if the target was not
valid and it was destroyed, set the visibility of
our widget to false. No. Let's just take that out.
If you run our game, you can see everything
is working fine. And if you move
over fighter jet, everything again
is working fine. If it destroy it, you get destroyed and now you can
see the coset is destroyed, there is no green box anymore. But one problem, one,
another problem. Let's say we have multiple
targets. What will happen? If you go to a level in here, let's just click on BP Target and create another
one of them, right? Hold on, drag on one of these axes and
create another one. Now we have two of them, one in here and one in here.
We have two of them, right? Now, if you run we game, we can display the first one. Let's see what will
happen the second one. Now, you can see it's
not happening anymore. It's not changing the
target to other one. You can see it is there, but we are not putting a target
56. 54 Destroy target event: No we have a problem. Whenever we destroy a target, it won't automatically lock on another target, and
we want to do that. Whenever we destroy target, it should automatically lock on another target and
how we can do that. First of all, when we log on
a target, what will happen, the target will be
valid and we set the UI position of
Amin to that position, to that actor or target, and we set the visibility. In this case, we want to check if the target was destroyed, automatically change the
target. How we can do that. We should find out when
this target get destroyed. So we get the target, and we bind the event on
its destroy event, right? So bind the event to
undestroy right, like this. So with this event, whenever the target
get destroyed, this event will happen, right? And what is this event? I want to create a
custom event for it, and I want to call it change target because the last
target got destroyed. Let's just test it
with the printer ring, and I want to say
target destroyed. No, let's just test that out. If we compile, save and run. And if we head over
target, you can see, when it destroyed, it
says, target, destroy it. So with this, we find
out when the target is destroyed and when we
should change the target. That's it. Now, let's see how we can change the target actually.
57. 55 Change target: Know when the target
is destroyed, we want to lock on another
target, but we can do that. Because we have a box
in here, this box, we can get all the overlapping
actor with that box with the node that is called
get overlapping actors. So with this, it will give us all the actors that are
inside this box, right? The box that we create
and it is too big. If you make it
visible, of course, you will be able
to see it, right? You can see it's too big. Whatever actor that
is inside this box, this node will give it to us, and it will give us an array that we can use to
check all the actors. If they have a tag
called target, we can switch to that. We can change the
target to that. So what we need, we
need for each loop, for each loop with a
break, for example, right? It will look through all the items inside this
array, and with that, we can check if this actor has tag or not, tag off target. So put target in here. If it has this target tag, we can check it with the branch. If it has it, this true
will happen, right? And if this true will happen, we can set the target, set this target with the R element with the target that we are
checking it, right? And when we set the target, we need to break
this for each loop. We don't need to go forward. So we connect this execution pin to this break so it will break. We need to add some reroute node with double middle mouse on it, to put it over here so it
looks better like this. Know what will happen. This forage loop with a break, we check all the actors
that are inside the box, and if one of them has
a target tag on it, this true will happen and
we change the target with this actor that is
inside this box, right? Now with that, let's
just take settled. The first part you
pick right? You see. And again, it will
go to next target, but we destroy this target, it's not going to
the next target. There is a problem. In next do, I will show you how you
can fix that problem.
58. 56 Third target problem: The problem that we
had with three target was that the first target
get destroyed completely. Okay, we switch to
the target two. But when we destroy
the target two, we are not setting
the new target. We are setting just
the target two because the priority that
this destroying happened it's not helping us. You know, that in our BP target, we are destroying the actor. But this destroy actor is happening after we
set the new target. That's why it will happen, this for each loop, it's setting the target
to the same target, to the same actor that
every time it's doing. So what we want to
do we want to check. If the target that we are
checking over here is the same as the target that we have in here, don't set it. In other case, we can say if this target that we are
checking and it has the tag of target was not equal to the target
that we have in here, we can check it with a branch. Let me make some space in here. It with the branch,
right? Case of true. If this target that
has this tag in here was not equal to
target that we had already, this true will happen, and now we can set
the target with this actor that has
this tag, right? Which is connected over
here. No, let's just run. If we shoot the first one, you see, it should go
to the next target. If we shoot this one as well, no, it should go to
the next target. No, you can see
it's working. Fine. If you add multiple target, let me add another one. Hold all and create
another one over here. No, we have four target. We should get this one,
after getting destroyed, if you go to the next target, this is the second one.
You can destroy that. Again, if you go to
the next target, that will be destroyed as well. The next target again, we can destroy that as well. After that, there
is no new target, so that's why it won't
aim at anything. So that looks good, but we want to be able to switch between target
with an input as well. For example, whenever we
hit R on our keyboard, we want to change the target.
59. 57 Change target with input: No for changing the
target with an input. How we can do that. Let's just go to content drawer in inputs. We need to create input action. So go to input input action. I want to call it IA,
change target, right? That's it. You don't need to
change anything inside it. We need just to map it, right? Add a mapping in our
IMC fighter jet. Go down because it will
create it down here. It's called IA change target. Again, it will go up,
it's refresh, right? In here, I want
to click in here, head R. So whenever we
hit R on our keyboard, we want to change the
target. Now with that. Let's just go to BPF 18. We have event for
changing the target. Let's just use it. Go
down over here at here. What I want to do, I
want to right click Search for IA hange Target, and with that, whenever we click on or we hit R on our keyboard. This started will happen once and we want to
change the target. So what this will do, this will forward that
change target event that we have it up here, right? These event. So all
of this will happen. Now, with that, let's
just test it, right? We can at R. You can see it, go to the next target, and it's up in over the target. Let's just one of them at R, another one, again head R, again R. Again has R. We can
shoot on another target. Let's just test
it one more time. I want to hold sheaves to go
into the tie and shoot them. And I want to hold
leftmost button this time. Then you can see and hit
the target. This one. Then it's hitting the target. No, just go back and
shoot at this one, head G on our keyboard to close gear it looks much better. You can see we are losing
the target right now. If we head, we can find it. Hold leftmost down and see if we are
shooting another one. We have another one in here that it automatically
change target as well. Again, we go backward
like this and. Fm and all of the targets are destroyed. So we are creating a game, but I want to add
more to this game. We are destroying some
stuff now, right? We have not any more targets, so everything looks good.
60. 58 Missile UI: No, we want to add
more UI to game. For example, how much
missile we have left. We want to have a UI of
that because sometimes we can't look at the
under the wings, right? So for doing that, I want
to go to content drawer, go to widgets, and in here, open up the WBPFeTen UI. We add throttle there, but no, I want to add
missiles as well. So for doing that, because
I want to have four of these missiles in a row I
want to use a horizontal box. So add a horizontal box to
our canvas panel like this. I want to anchor this to bottom
right corner, like this. Now with the anchor
points set to bottom, right corner, what I
want to do I want to put the position X and
position Y to zero. Now, you can see it over here. I want the alignment to be aligned with bottom
right corner of this. So bottom right corner
of this should be on the anchor point whenever
the position and Y are zero. So we put one and one, so you can see
bottom right corner is at the anchor point. No, I want to position it
alongside this throttle, right? So I can put -150 and -54 Y. That's it. For the size, I want to put a 264
and the size Y. On it, put it on 194, right? I think that is a
good one, right? No, I want to add some images
for showing the missile. So in here, add
an image in here. And the image that I
want to choose search for missile and the missile,
I want to put it there. Now with that, we need four of them. So
click on this one. Control D to duplicate,
duplicate, duplicate. Now, you can see
that looks good. Select all of them. And I want to add some
padding in here. So let's just go to padding and pad to the left
like five units. No, you can see it. It's nice and tighty there. And we have some padding around
them to the left, right? No, I want to name them
because it is important. The image on the right side, I want to name it
one for missile one. The image after that, I want to put two in there. For the other ones, I want to go here to
look at them, right? So you can see this on the right wing is
one or missile one. After that, we have missile two. No, on the left side, the missile three
is the left one. So that's what we
want to do in here. So if I click in here, this is the M three, right? And this is four
or missile four. And we need to select all of
them and make them variable. So we can write code
for them, right? Let's just compile, save. No, let's just go to graph. And in here, I want
to create a function for setting the
Missi visibility. So when we shoot them, we
want to make them invisible, and when it's reloaded, we want to make it visible. Create a function. I want to call it set missile visibility, set
missile visibility. And this function, I
want to have an input. So let's just put an input. The type I want
it to be integer, so we tell it which missile
visibility should be changed, on call this one
missile number. Okay. With that, we can switch
on this missile number like this switch on t so
we have four missiles, so let's just add four of them. We know that we have missile
one, two, three, four. We don't need this zero, but
let's just leave it there, and we don't need this default. You can just leave it there. No with that, we want to make things visible
or invisible, right? So again, we need an input. In here, click on the function
as an input this time, I want it to be a bullion. And I want to call it
visibility T, right? Visibility. Now, if
the Missile one, we wanted to change
the visibility of it, we can get the Missile
one like this. We want to change
the visibility. So search for set visibility, right, and we want to check
the visibility input, right? So we want to check with
a branch like this. And in case the
visibility was true, we can get the visibility
like this, visibility. It exactly like connecting these two here because
we are in function, we can do this kind of stuff. This is a function input, right? So if the visibility was true, we want to make it visible. And if it's not true, the false will happen, and in that case, we want to make it hen. So choose hen, right? That's it. We can just
grab all of these, bring them a little bit up. So we have some space, control set copy it, control Weed paste it. We want to do it
for Missile two. So replace Missile one with Missile two and connect
the number two to here, right? Exactly like before. Control ed paste
it two times more. And this one is
for missile three, so connect the missile
three to here, and this one is
for missile four. So let's just connect
missile four. This is for missile
three, so put it 23, and this is for missile four
connected to missile four. That's it. We have
a function that we can change the missile UI. If we run, you can see all the missiles are
there and if you shoot, nothing is changed, but we can go to BPF
18 in event graph, go down when we are changing the visibility
of over missiles. What we can do, we
can create some space like this in here and we can get the FATNUI I want to call this function that is called set missile visibility. So let's just call that
set missile visibility. This is for missile one. So let's just connect
it like this. This is for missile one. So put one in there, the new visibility, we want it to be invisible,
so that's good. No, we can just copy and paste this and after it's reloaded, we can make the visibility
back to true, like this. No, let's just test that. We run over game, look
at the missile one, if I had leftmost, go wait after 2
seconds will be there. That's good. We want to do the same for the others as well. So we need some space. Create some space for
all of them like this, like this, and for this one
as well, create some space. And no with that, we can just copy and paste this to here, I need the execution pin so
let's just give it that. This is for missile two. So just put two in here, and we need to
reload it as well. So control to paste
set in here as well. This is for missile two, and we want the
visibility to be true, like the missile under
the wings, right? The missile two is okay. Let's just do it for missile
three, paste with control. This is for missile three. So put three in there. And at the reload, we wanted to change the
visibility to true again. This is for Missile three. Put the visibility to two. That's it. Now, let's just
do it for Missile four. We just control V to paste
in and stuff, right? You should learn copy and
pasting to use it a lot, right? We make it invisible and
after reloading in here, we want to use
Control V again to make it visible
for Missile four, make it visible, and that's it. Let's just compile,
save and run, shoot all of it. Se all of it. Working. That's good. What I want to do know in here on set this time
with a variable. Right now, it is a two,
two is for just testing. So that's why I want to create a variable of type of float, and I want to call it
reload time. Okay? And I want to head compile
and put five in there, right, and connect the
reload time to this time, right, for all of them. So let's just do it. With this, whenever we want
to change the reload time, we can go to this variable
and change it really fast. Don't need to go
everywhere, right? No, it takes 5 seconds
to reload process. Two, three, four, five, and it is there, right? See after 5 seconds. Ah. That's it. After five second no, the missiles will be reloaded. And whenever we want, we can change it over here
the load time.
61. 59 Calculating GForce: No, I think everything
looks beautiful. But whenever we hit something, the plane, the fighter
jet don't get destroyed, and that is a problem. I want to show you
how you can fix it. For fixing that, I want
to right click in here, close other tabs so we have
a cleaner slate in here, and for deciding when to
destroy a fighter jet, we need to calculate the G
force and how we can do that. I did search it in Internet, how to calculate
the GFceOr you can just search for GFoce
calculator in here. And it is in Omni calculator. It did explain everything. If you go down, you can see it will give us the
equation for that. The difference
between the velocity, divided by time
multiplied by gravity, and it will give us some value. For example, if the V zero is 60 kilometer and v10 kilometer, and the time that
it takes between V zero velocity zero and
velocity one was 1 second. We can calculate that with this equation that we have in
here. So know what we need. We need the time, we
need the gravity, and we need velocity, two velocity from two separate
frame. How we can do that. Let's just go to Eventiq. We want to do it with eventiq because it will give
us the Delta second. So we can save the velocity for the last
frame and this frame, and we have the Delta second that it take
between each frame, and we have the gravity as well. With that, we can calculate
the G force, right? And if the G four
get more than ten, 12, 20 or whatever, we can destroy the fighter jet. So for doing that,
we need some space. Let's just grab all
of this, bring it up, head C to add comment. And in here, I want to
name it targeting system, okay? This is for this one. Now, we have a din
one that in here, we want to calculate
the G force. For doing that, I want to add a variable first
for the velocity. I don't want to call
it just velocity. I want to call it
current frame velocity. I want to duplicate
that, and this time, I want to call it last
frame velocity, right? So we need two velocity. One for the current
frame velocity and one for last frame
velocity, right? So how we can get the current
frame velocity, actually, we can click Search for Get
velocity, and that's it. This is the current frame
velocity that if we get the vector length of this
vector length of this, it will give us the
current frame velocity, and we can save it in
current frame velocity. That's it. We have the current frame
velocity, and in here, let me create a comment in
here, calculate G force. And let's just put it over here. So what we are doing, first, we save the current
frame velocity, and after that, we are
calculating the G force, but the last frame
velocity, what is it? It is zero by default. When we play our game, the last frame velocity is zero. So we calculate the G force
with that last frame velocity zero and the current
frame velocity that we get from get
velocity, right? And after calculating the G
force, what we want to do, we want to save the velocity for the next frame inside
the last frame velocity. So we set it over here. With again this value, getting velocity
vector length, right? So after we calculate
the G force, we need to save the velocity for the next frame and we will do it
in here, right? We don't want to
do this right now, we make this bigger because
we need more space. First in here, based
on this calculation, we need to subtract
V zero from V one, right? So let's just do that. The V one is current frame
velocty, so let's just get it. We want to subtract it by zero, that is last frame losty. No, we want to divide this
divide it by let's see. T multiplied by gravity. How we can get the time, the time we can get
it from Delta second. Either we can get it like this, but I don't want to grab
this from here to here. I can rightly search for
Get word, Delta second. That's it. Now, we want to multiply this by gravity, right? And how we can get the gravity, we can get it from or
vehicle movement component. There is a get gravity z here, and connect it like this to
here and connect it to here. Now we are dividing
the substraction of current frame velocity by last frame velocity divided by time multiplied by gravity. That's it. What
this will give us, it will give us D G force. So promoted to variable, and I want to call it G force. Okay? G force? I did create it down here. No, we can't connect
the execution pins. Will explain it one more
time because I know it can get a little bit
confusing at some point. Let's just grab all of this, bring it up like this, and make this comment
a little bit bigger. So what we are doing, first, we are getting the
current frame velocity we get velocity
actor length, right? And the last frame, so we have the current
frame velocity, and the last frame velocity at the beginning will
be just zero, right? No, we need to substrate
these two together and divide it by time that it take from last
frame velocity to the current frame velocity
multiplied by gravity. And this will give us
the G force, right? And after that, we are saving the velocity
for the next frame. So we can calculate the G force in the next frame as well. No, I want to just
print the G force. Use a print test string, and in here, I want to connect the G force to here. That's it. No, if you run over game, you can see, because it's
a little bit moving, it will give us some G force. But if you move, you can see the G force is getting
bigger and bigger. This is exactly like real world. And if I go like this
and hit the ground. Let's say you want
to hit the ground. Now let's see what will happen. The G force is getting bigger. No, you can see it did
give us a big value. You can see it, but I can
go to Output Log and go up. You can see it will give us
130 when we hit the ground. So we can use the G force to when to destroy the
fighter jet, right? Another thing. This G force
can be a negative value, so we can get the absolute value of it and after that, show it. So you can see, no, it is always in positive, we can decide if it
get more than ten, it will be destroyed, for example, you can
see how it is changing. And you can see how the
big value it can get. If you go to it Wood Log, you can see it over here, but it happened just one frame, for example, we
have seven in here. Again, if you go up, we have six in here. When we are doing some turns, we have 34, 28, when it hit the
ground, it is more. We have 33, 34. So we can say, if it
is more than ten, destroy the plane, right? Like real world. We don't need this
printer string. No, we are calculating
the G force, let's see how we can destroy
the fighter jet with that.
62. 60 Destroy Jet part01: No, with calculated G
force, we want to check. If it get more than
certain value, we want to destroy the fighter yet. Let's see how
we can do that. Where I want to do that whenever we are calculating
the velocity, right? So at the end in here, I want to check with the branch. Okay? I want to check with the branch, the G force, right, get the G force,
and in here, first, get the absolute of it so we don't have any
negative value. And after that, we check
if it is more than ten, for example, we can
destroy the fighter jet. So let's just put it there. First thing first, if the
G force get more than ten, the true will happen, right? And I want to create a variable to tell it that
the jet is destroyed. So let's just create a
variable of type of boolean. And in here, I want to
call it jet, destroy it. Jet destroyed and we want to set it over here, first
thing first, right? TT. But by default, the jet destroyed
should be false. Now, when the jet jet destroyed, first, we want to
have explosion, so we can spawn system, spawn system at location. The explosion that
I want to have is just this dust
explosion, right? We're at the location
of over actor. Get actor location, right? That's it. No, let's
just test that out. If we run our game, and we should go up and
hit something, right? Go up and no hit the ground. And no, you can see,
we have explosion. We can have moved prog,
right? You can see. Again, we had another one. But we want to do
other things as well. So when it gets destroyed, you can see every time that
the G four get more than ten, we have explosion, right? But we want to do other things. So we don't want to let the fighter to move
that much, right? So next thing that I want to do, I want to turn off the engines. How I can do that, I can get the right engine and
left engine like this. And these are just some
no graphics, right? We can set the
visibility on them, set visibility to not
be visible, right? Connected like
this. Both of them, we wanted to set the
visibility to fox. Next, the engine
sound MS jet sound. I want to get it over here, and I want to change
the volume of it. So set volume
multiplier to zero. So we don't have any more jet sound because
it gets destroyed, right? Right? Now, let's just
compile and pass that hone. Go up and down and play
fighter just look at it. That's it. The engine is gone, and the sound is gone,
as well. That's good. But one other thing after this
spawn system at location, we need explosion sound. So I want to grab all of these, bring it to the
right, and in here, I want to spawn a sound
at location, right? The sound that you want to play, click in here, we had it. We can just disable the
show engine content, so we will see just
the ones that we need. Generate explosion,
that's more than enough. And location, we
can copy and paste this to here and connect
it to the location. Now, we will have a
explosion sound as well. So you go up, and Go done. Yeah, that looks beautiful. You can see No
everything is good. No next thing that
we want to do. We want to stop the
movement of our vehicle. So we can get the vehicle
movement component and tell it to stop stop movement
immediately because you get destroyed, right? Now, let's just
again, head compile, save and runo game, Hold ship, and go up. After that, go down. You can see, it did stop moving. But if we hold shift,
again, we can move. So another thing that we
want to do we want to prevent our fighter jet
to move completely. For doing that, we have a lot
of ways that we can do it. For example, like we add
a map in context, right? We get the enhanced input from
our Git player controller. Let's just get it
over here as well, paste it in here with
Control V. And this time, let's just say remove
mapping context. And the mapping context
that you want to remove is IMC fighter
jet. That's it. Let's just connect it to here. No runaway game. We hold left sheet. We can change the throttle, go up, and know if we go
down, let's just see. No, we can't have any
more movement, right? Doesn't matter what we do. We can't have any more movement. This was one way to do
it, and it's good to.
63. 60 Destroy Jet part02: No, we have other ways as well. If you don't want
to do it like this, you can just use this jet destroyed to tell the
inputs not to happen. For example, we want to
be able to look around, but we don't want to
change the IA trust. So in here, we can
use a branch, okay? And we check. If the jet
destroyed was false, you can change the trust in
case of false like this. We can do it for
other ones as well. For example, the brake. We don't want it
to be able to do that if the jet is
destroyed, right? So if the jet was not destroyed,
you can do that, right? Again, we have a
hand brake in here. Again, we want to check it if the jet is
destroyed or not. Both again, let's just go down. For IA Pitch, again, we want to do the same in here. So connected like this to here. In case of false, you can change the pitch value. Again, in here,
we want to do the same with Jet destroyed. Connected like this, I
Jet was not destroyed, you can change the role value. Again, let's just go down, make some space, control
V to paste it over here, and know in case of false, you can change the ya value, right do it for everything. For example, I gears. We want to check. If the
fighter jet was not destroyed, you can close the gears. Again, for the firing, we want to check that as well. Like this, in case of falls, you can fire missile, do we have another one? Change target. Again, we
want this change target to happen if the jet destroyed
what was false, right? So now with that,
we don't need to do this remove map in context. Let's just test that out, no. We can decide what input should be enabled and what input
shouldn't be enabled. With removing map in context, everything will be disabled. But this time, it
will be destroyed, but we can look around, right? Next thing that you want
to do, let me remove this. I want to just to show you
some other ways to do stuff. We want to change the
mesh of our fighter jet, the material on that. So get the mesh in here and set the material on
it because right now, it's like it's not
destroy at all. Set a material in here. The material zero will
be the main material, but the material that you
want to use is called vest fighter jet F
18 damage, right? Just put it there.
Now if you hit compile and run with game, and let's just go up into the sky and hit the
ground after that. B and you can see, no, the material of it
is changed as well. That looks awesome. Next thing that I want to do, I don't want this to happen if the jet is
destroyed, right? Not the targeting, not anything. So in here, we want to check if the jet was not destroyed. So let's just use
a branch in here. You can calculate everything, calculate the G four, manage throttle Vafxs
and everything, right? But if the jet was destroyed,
don't do anything. Again, let's just
test settled note. You go up, and go down
and it is destroyed. No, if it hit the ground, it won't create
another explosion. One other thing that we have, we have some missiles
that it's not affected. So let's see how we
can fix that, no. If we go here at the end, when the jet destroyed, we want to get all the missiles like this, get all of them. And missile one and set the
visibility on them, right? We say set visibility to tell
them that it is destroyed. For all of them, we want to
set the visibility to false, connectors like this and
know if you run or game. I think this time,
everything is perfect. But whenever you find a bot, just let me know in question section or
in this core channel, so we can fix it together. I will update this course
always so you can see, no everything is
working fine and we are destroying the jet and
nothing is working anymore.
64. 61 Import sam system files: No we need some enemy that they can shoot us and destroy us. And for doing that,
we need some files, some files for enemies,
skeletal mesh, right? So at description of this video, there is a zip file
that is called 60 ones dot Zep. Donnload it. Put it on your desktop and
don't click on it to open it, and there is a SAM
folder in here. Dragon drop so you extract
it just like this. And inside this SAM folder, it should be just assets folder. This is really important. You need this sum folder that after that there is
assets folder inside it. This is really important because the path that we are using
in here is really important. Now, go to your project, go to Content drawer, right click on content
folder and show Explorer. No, it will open up the
content folder for us. Now we can just write and drop this sum folder
over here, right? Make sure after this sum folder, there is asset folder inside it, not another SAM folder, right? Now with that, if you go back
and open up the project, and if you go to content drawer, go to S folder, go to Assets folder. You can see some stuff in
here that is from Vigilante. And here, you can see, we have a radar. Let's just look at it.
This is our radar, and we have let me
show it to you. Call movement vehicle. We have a missile system that is like this,
right? That's beautiful. No, we want to use
these two radar and the SAM system to shoot at
fighter jet. Let's say, we can
65. 62 Radar blueprint: Now let's see how we can create some system with the radar so it can shoot down over fighter jet. For doing that, I want
to go to Content drawer, and I want to go to S folder. Let's just do something in here. Content folder, I want to
right click on Fighter jet, set the color on for
example, green, right? And for the SAM folder, I want to right click on it, set the color to
a new color like blue or red because it
is the enemy, right? Now, let's just go to
SAM folder in here. I want to create a new folder, I want to call it blue
print or blueprint. Don't click on it to open it. I want to right click in here, create a blueprint
class of type of actor, and I want to call it BP radar, okay? This is our radar. I'll click on it to
open it right now, there is nothing in here. I want to add a
skeletal mesh first, add a skeletal mesh, put it at default scene root, and now with that, I want
to choose a skeletal mesh and I want to choose a SK
west radar Patriot, right? Just put it there.
This is our radar you can see the door of it
is open. That's cool. Now this radar should
have some animation, but just for no, I want to
add a sphere collision. Search for a sphere and
choose a sphere collision. With this sphere collision, we decide which target
to be attacked, right? Which target to
locked on, right? The Sphere radius, I want
to put it on 20,000. So put 20,000 there. And for now, what I
want to do I want to go down and make it not
hidden in the game, right? That's it. Let's
just at compile, save and put one of
them inside our level. I want to find our
players start. It is down there with heating F, it will focus on it on at one of these radars in here
like this, right? And now you can see, we have
a radar that can find us. If we run over Game, we can see the
radar there, right? No, what I want to do, I want to go to player
start and in here, I want to rotate it so
it will face the radar. In here, put zero in here. Now if you run, you can see our fighter jet is
facing the radar, no, and radar can lock on us when we are inside this
collision sphere, right? No, it's not doing anything. Next thing to do, we need to rotate this, right, rotate the radar. So it looks like it's searching for a fighter
yet, for example, right? You know how to do that. There are some bones
inside this radar, and you have all the
knowledge to rotate this. And one other challenge
that I want to give you is to close this door with bones
in animation blueprint. So you need the
animation blueprint for closing this door, and you need that
animation blueprint for rotating this whole radar. So you try to do that.
We will do it in next.
66. 63 Radar door: First thing that we want to do, we want to add some animation to our radar so it can rotate, and we want to close this store because it
doesn't look good, right? No, for doing that,
I want to go to Content drawer and in
here in some blueprints. I want to right click and go to animation and create
Animation Blueprint. It tells us which
skeleton you want to create animation for
Animation Blueprint for, I want to choose the
radar and it create. I want to call it ABP radar. Okay? Don't click
on it to open it. And know in here, like always, we want to add the
mesa space f pose. So it will give us the
information about all the bones. First thing that you
want to do in here, we want to close up these doors. So we need to find the
bones that with that, we can close this door,
how we can find it. If we click in here, we go
to a skeleton, and in here, let's just find the door by searching door in
this skeleton tree. You can see the
door joint in here. We need to rotate it around
the Z axis 90 degree, right? So that's it. It's
-90 degree, right? So for doing that,
let's just go to ABP radar and we want to
use Modify Bone, right? We did use it a lot. Just click on it. We need
to change some stuff. The bone that we
want to modify is called Doroin door joint. We don't need to change
the translation, so we can click in here, tell it not to
expose it as a pin, and we want to do it
for a scale as well, so it won't expose it as a pin. No, it's cleaner, right? No, for rotation, we want
to add it to existence, and the component space
is more than enough. No, we need to rotate
this door around the Z axis 90 degree -90 degree, of course, put -90
there and connect the pose pin or execution pin to output pose, no head compile. You can see the
door no is closed. No next thing that you
want to do we want to rotate the complete
radar, right? Right? No, it's
just staying still. We want it to look good, right? For doing that, let's
just again go to our skeleton to see which
bone we should rotate. And here in a set of door, I want to search for base. Okay? There is a launcher
base joint that with that, we can rotate this. You can see we want to rotate this forever so it
can find something. It's just for
visualization, right? Now that you know
with which bone, you can rotate this. So this is a challenge for you. Rotate it, so our radar looks
good. You try to do that. We will do it in the next video.
67. 64 Radar rotation: Rotating our radar, so it
looks natural and good. For doing that, we want
to go to ABP radar, and we want to use
the same node. So we use Control C control
V to paste it over here, connect the pose pin
or execution pin. No, we need to change
the bone to modify to the base one that we find
launcher, base joint. Okay? Now, if you hit compile, you can see when
we change the ya or rotation around the
Z axis, it will change. If you put 20 in there, you can see it happened
without compiling. 30, you can see, 40, you can see, it's working. Now, we want to
just change the Z. The ya we can right click
on it, split stroke pin, so we have axis
just the rotation around Z axis or ya Okay, let's just put
zero for no there. No, we need a variable that constantly changing
by each frame. So we can rotate this bone. For doing that, I want to
go to event graph, right? And in here, I want
to create a variable. And I want to call
it radar rotation. Okay? And the type, I want to put it at float. And at default, if
you compile it, you can see at
default, it is zero. We need to grab it. Add a little bit to it, for example, with this
Delta T x, right? So we add Delta time to it. So each frame, it
will be changed, and we want to save it inside
itself after that, right? So each frame this
radar rotation will change a little bit, right? Now, let's just use a printer string to show it to you printer ring like this. And with that, no, you
can see just with that, you can see there is a value in here that is
constantly changing. For you to see it better, if you go to BP radar, which should click on a skeleton
machine here and choose our animation blueprint in
here that is called ABP radar. Now, if you run over game, you can see it will
start from zero and each frame it will be
increased. That's good. Now, what I want to
do I want to use this radar rotation
to rotate or bone. But if you just connect
this radar rotation to rotation around the Z
axis, let's just look at it. You can see it's changing a little bit for you
to see it better. Let me run or game, eject from here and now
let's just go to radar. You can see it's moving, but it's so slow. We need to increase
this movement. How we can do that, we can just multiply this
by some value. By whatever value that
you want, like 50, right? You decide what you want to do. Now, you can see it will
rotate much faster. Now, if you run over game
and eject from here, we can go to radar, so we can look at it. You can see Now that looks good. Or radar is good enough.
68. 65 Radar lock on system: Next thing that our
radar needs to do is to log on a fighter jet and
how we want to do that. So for doing that, I want
to go to our BP radar. There is a sphere collision
in here that whenever our fighter jet
collide with it or begin overlap with it,
we want to log on it. So let's just go to Event graph. Click on this sphere. In here, go down until you
reach on begin Olap. Okay? Begin overlap.
Click in here. No, it will create
a event for us. But how we can find out if our fighter jet collide begin overlap with it because we have lots
of actors, right? So let's just test something. If we use print testing and show the other actor
name just by this, if I compile and run, you can see by default, it is say, the BPFAT is
there, why it's happening? It's because the component begin overlap detect this big
box collision as well. This big box collision that
is not visible right now. So if I make it visible, no, you can see it will find
this big box collision. And if I don't make it hidden in the game,
we can test the top. No, you can see the
big box collision for this fighter jet is colliding
with that sphere collision, and we don't want the radar to lock on fighter jet
because of its box collision. So what do you want
to do, first of all, let me make this not visible
and hidden in game as well. Now what I want to do, I want to go to BP radar. And in here, I want to
check it with a tag. So we need a tag
inside or BPF 18. I want to click on or mesh. Okay? Make sure it
isn't the mesh, and search for tag. And in here, I
want to add a tag, and I want to call it F 18. Body. F ATN body. Control C to copy it. Okay. Now with that, if you
go to our VP radar, this event will give us the component that overlap
with this sphere collision, this sphere collision
of our radar, right? So with this, we can check if the component has a tag
with the name of FATN body. In that case, I want
to use a branch. In that case, you can log on it and say that
this is our target. Right now, let's just
use a printer string. And I want to say radar
locked on a FATen, right? That's it. Let's just
head compile and run. No, you can see it
won't say anything. If we go forward and overlap
with this sphere collision, let's see what will happen. Now, it says, radar lock on FAT. That's good, right? Now, we
are finding a FATN correctly. With this locking, what
do you want to happen, we want to fire a missile. What right now, we don't have a missile. We will do it later. But for now, let's see if
we can destroy this radar, how we can destroy it. Just think about it.
We will do it in next.
69. 66 Radar hit event: No, let's see how we can destroy this radar with our fighter jet. For doing that, let's just go
to our fighter jet folder. In here, find out the target,
what we have done there. In here, what we have done, we just click on our
BP Target and in here, search for a tag, and we add
the tag of target there. So we should be able to do that inside our BP radar as well. So in here, just click
on the BP radar itself, and in here, search for tag
and in here, add a tag. I want to call it target, right? Just like that, if we
had compiled and save, let's see what will happen. Now, you can see, we
fighter lots on it. So that's good, right? Let's go forward and shoot at it, right? Shoot. No utility. This hit it. Cool, right? So by just
adding a tag of target, we can target it. Now, let's see how
we can destroy it. If you go to event graph or
click on or a skeletal mesh, just cancel this search, go down and search
for component hit. Okay? So whenever the
missile hit this radar, it should fire up
this event, right? So let's just test it with the printing to see if
it's happened or not. And I want to call
it radar destroyed. Okay? Radar destroyed. If you run over game now, you go forward and
shoot over man. You see it's shooting it, but it's not happening. This printer ring
is not happening. This component hit
is not happening. One problem that it made
this happen is that if you click on our skeletal machine here and go to
collision section, let me find it in here. Collision section, you
can see by default, it is saying no collision. If we change this to block all, it will block everything. And after that, teleto
simulation generate hate it. Just check that head compile. No, let's just settle. It should block
everything, right? You go forward. Just look at it, to go forward and shoot at it. No, you can see it says, radar destroyed,
radar destroyed. Let's go back like this
and shoot at it again. You see, when it hit that, it says, radar destroyed. And no, we are hitting it right. And if we hit the
ground, we will destroy. We will be destroyed as well. So no, radar get destroyed
and we get the event. No, we want some
effects as well. So we know that it is destroyed. L see we can do that next we
70. 67 Damage Radar: No, for destroying our radar. We need some visualization that we can tell it that
it is destroyed, right? So for doing that, if you
go to content drawer, go to S, go to
assets and in here, go to vigilante content
vehicles, the radar, you can see if we go
to damage folder, there is a damaged
radar system in here. So that's cool. We can use that. You can see the tires in here, you can see the radar itself
is just a static mesh. It's not a skeletal mesh,
so that's good, right? And we have some
effects as well. If you don't click in here, in EffexFolder, dog click
in here so you can see it. In here, no, you can see, we want to use this visual
effects on it as well. Oh we can use it. If we
go to Content drawer, I want to go to Sam
folder, go to blueprints. I want to right click in here, create a blueprint
class of type of actor, and I want to call
it BP damaged Radar. Damage radar. Dot click
on it to open it. And in here, we want to
create a damaged radar. So we need a static
mesh this time because the damage radar is
just tatic mesh. So add a static machine here, put it as default se root by dragging and
dropping it there, and the static mesh
that you want to use is called West radar
Patriot damage. Put it there. Now you
can see it is now, again, click on ad, search for Niagara
system particle, and in here, choose the
NSS radar patriot damage. Put it there. Now the visual effects
will be there as well. Now we have a blueprint
that we can use whenever the radar is destroyed. Let's see
how we can use it. Go to BP Radar. We don't need this
printer ring anymore. What we want to do we want to whenever something
hit this radar, we want to spawn a
actor from a class. What is the class? The class
is BP damaged radar, right? It needs a transform to
tell it where it is. We can just rag and
drop it and say, get actor transform.
That's more than enough. No, after spawning
this damaged radar, we need to destroy this
radar that we have in here, just destroy actor, this radar that is not damaged, right? Just with that, let's
just go to our level. If we run over game, go forward. I go up and shoot
at the time, right? And know with that, if I hit, I can jig and go to our
radar. Just look at it. No our radar gets
destroyed successful. You can see because we hit it, it did destroy successfully, and that looks awesome. Since that is all claim, we can go inside it
whenever we go, right? That's it. No, we are able
to destroy the radar.
71. 68 Missile system blueprint: No over radar, find over F 18, but it can't for a missile because it doesn't
have any missile system. So what I want to
do, first of all, let me close some of this stuff that we
don't need anymore. Close this one. We need
the BP radar for now. Go to Content drawer,
right click in here, create a blueprint
class of type of actor, and I want to call
it BP radar missile. System, okay, or whatever
you want to call it, don't click on it to open it. Again, in here, I want
to add a skeletal mesh. So search for skeletal
mesh in here, and I want to drag and drop it, put it as default
snroot and choose our SK east AAT, right? This is our missile system. And right now you can see
there is no missile in there, but we have some tracks there that we can
put missile there. So let's see what we can use. Click in here at a
static mesh for no, at a Static Mish. And in here, there is a
static mesh that is called SM East AASAT Missile.
Just choose that. Now, you can see
where it created because it is child
or a skeletal mesh, we can choose a parent
socket where to put it. For example, rocket
socket one, right? Now, you can see it is at the right place. We
need four of them. So let's just name this one. Control D to duplicate it. Again, Control D to
duplicate it one more time. Again, control D to
duplicate it one more time, because we need four of them because we have four
tracks in here. No, click on two. Click on the parent
socket and put it on rocket socket two. Now,
you can see it is there. After that three, again, click on parent socket. This is rocket socket
three. That's it. Now, for the fourth one, again, we want to put it
on the fourth one. No, you can see all the
missiles is at the right place. Let's just put it
inside our level. Where we want to
put it, we want to put it close to our radar. It doesn't matter if it's
close to our radar or not, but that's how it
should be, right? So put it, for example,
over here, right? No with that done. First and first, we want to rotate it a little
bit up, right? So how we can do that? We can do it with
animation blueprint. So I want to give you
this as a challenge. Try to rotate these
missiles up for no, and we will do it next video.
72. 69 Missile Looking up: Know for rotating our missile
system a little bit up, so it will face over
fighter jet, for example, whenever necessary, we need to go to content
drawer and in here, create animation
blueprint for that. So go to animation and create
animation blueprint for our SKLeas AASATe right? Head create and I want to
call it ABP missile system, missile system or radar
missile system, right? With that, I want to go to
our BP radar missile system, click on or skeletal
mesh, and put it there. Search for ABP missile system. Nothing happened because
we didn't do anything in here in our ABP
missile system. So I'll click on it to open it. Like always, we need
to get the mesh space, ref pose in here, so it will give us all the
information about the bones. And after that, we want to use a modified bone to
modify one of the bones. Let's just connect it
to output pose in here, and after that, we will decide which skeleton we
want to change. For doing that, I
want to click on the skeleton in here
and know in here, you can see some stuff in here. For example, there is a missile pylons
joint that with that, we can rotate this
up a little bit. For example, 35 degrees, right? So we need to
change the rotation of or missiles pylons joint. So let's see how we can do that. In here, first of all,
click on this node and choose the pylons.
Search for pylon. Ms size pylons joint, not GAO, just joint, right? We don't want to change
the translation. So click in here, don't
expose it as a pin. We don't want to change
the scale as well, so don't expose it as a pin, but we want to
change the rotation. And for the rotation mode, I want to put it to
the add to existence, and component space
is more than enough. What do you want to change
in here, let's just check. If you look at here
because we click in here, it will show a rotation
around here, right? You can see we can change it
and see the fakes in here. So we need to change the pitch. For example, to 45
degree or 35 degree. You decide what you want to do. I want to put it on 45 degree, right? That's all we need to do. No, it is up. And if you go to our level and run and eject so we
can go and look at it, you can see it's 45 or 35 up. That looks good,
right? That's awesome. We did rotate or missi
it will look up, not in the ground, right? So no makes a thing
that you want to do. If you look at here, you can see the hydraulics,
it's going inside. Let me go and you can see the
hydraulic is going inside. So we need to pull it back
a little bit to here. And how we can do that, again, we can do it in animation
blueprint, right? So I want you to do this as a practice so you will
remember it always. Try to do it yourself. We'll do it in next video.
73. 70 Missile rod position: No, for changing that hydraulic.
Let's just look at it. If you go to a skeleton, you can see we have a
hydraulic rod joint. We had W, we can change
the position of it, right? It should be over here, right? It should be over here. So we need to change the
position of our hydraulic rod. Let's just go to ABP
missile system in here on to use
modified bone again. And in here, I don't want
to change the rotation. So click in here, don't
expose it as a pin, and for the scale, I don't
want to change it at all. Just the translation. I want to click in here at
the existence, and that's it. What we need to change, we need to change
the hydraulic rod. So hydraulic rod,
just choose it there. Now, if we go to our skeleton, you can see we want to change the position along the X axis. This red one is X axis. You can see it over
here. Now, let's just put some value there. Or we can go here and change the position
like this, like this. And you can see -55
is more than enough. So put -55 there. Just with that, let's
just go to a level run. And eject so we can
go to there at F. Let's just look at
the Hydraulic rod. You can see that looks good. It's not inside the
missile system. That looks good, but no, we want this missile system
to look at the target. I should face over target. But right now, our radar
knows about target, but this missile system
doesn't know about it. First thing to do,
we need to let the missile system
from the radar system to know where is the target
and we will do it next.
74. 71 Connect radar system to missile system: Know what we have. We have a radar and we have a missile system that we need
to connect them together. And how we can do that,
there is an easy way. Let's just go to our BP radar. First, we need to tell
this BP radar that this BP radar missile system you should be connected
to inside this level. So what we want to
do we want to tell this radar system that this
is your missile system. So if you find a target, pass it to this missile system so it can shoot at it, right? So for doing that, I want to
create a variable in here, and I want to call it missile. System. And the type of it, I want to search for BP missile, BP radar missile system. The type of it, we want it to
be BP radar missile system. So with this variable,
what will happen, we can tell this radar system that this is your
missile system, that you should pass the
target to it, right? Know how we can actually tell it that that
is your missile system. We need to click
on this variable, make it in stance editable, and expose it on a span. So with that, if we compile
save and go to a level, no, you can see the missile
system variable that we create in
where blueprint, it is in here as well. So we can tell it which
missile system is your missile system by clicking
in here and it will give us a color pickup
that we can choose a missile system that we want it to be connected
to the radar system. So click in here.
Now with that done, the radar knows that this
is its missile system and it should pass the target to
it so it can shoot at it. Now, let's see how we
can pass the target.
75. 72 Pass target to missile system: Know that our radar is connected to the
missile system and knows to which missile system
should pass the target. Let's see how we
can pass it, right? So with this variable
missile system, we know which missile system in our level we
are connected to. So we need to pass the
target to it, right? So for doing that,
I want to go to BP Radar Missile System. And in here, I want to create a custom event,
right? Custom event. And I want to call it set
Missile target, right? Set Missile target. And in here, we want to have an
input for this event. For doing that, we
can just click on it, add an input of type of actor, and I want to call it
target, right? That's it. We need to promote
this to a variable. So promote it to a variable. The type is actor, it
will create it for us. Now with this event, what I want to do I want
to use a printer string, and I want to say missile has
a target to shoot, right? And the color of it, I want to put it on red so you can see it better,
just like that. Now that we have
this custom event that is called set
missile Target. We can use it inside our radar to pass the
target to it, right? So we can get our missile system that this
radar system is connected to and use its custom event
set missile target, right? It's just like a function. And we can pass the
target to it, right? So we can get the
other actor that has this FATN body inside it
to the missile system. Now with ton, let's
just compile, save and run over game, and know if we go forward, and when we overlap
with this sphere, we'll see what will happen. Radar find it and pass the
target to the missile system. Again, let's just
go inside it again. Like this fight that. You can see it will
say the missile has a target to fire, right? Now with that done, next thing that we
want to do we want to face over missile system
to the fighter jet. Let's see how we can
do that in next video.
76. 73 Missile system Rotation: No we want our missile system
to look at our fighter yet. Let me show it to you
that it's not doing that. For doing that, let me
grab our players start. That is over here, bring it forward like this and go over here
and put it here, right? Bring it up a little bit. Now, if you run over again, you can see our
fighter jet is here, but our missile system
is not looking at us. So that is a problem, right? So let's see how
we can fix that. For fixing that, let's just
go to our ABP missile system. And in here, let's see how we can rotate our
missile system first. For doing that, go
to a skeleton in here and find the bone that
we should do it with, right? We can do it with
cog joint, right? In here, if I hit
E, I can rotate it. We want to rotate it like this. So that's more than
enough, right? That looks good. No
for rotating this. We want to go to
ABP missile system. Use this changing rotation, Control C to copy it, right? Is for location or translation,
and this is for rotation. So we copy this one, right, paste it over here and connect the execution pin or
post pin to it, right? We want to change the
rotation around the Z axis. So right clicking here,
split the stroke pin. We need to put this to zero because we don't need to
change the pitch, right? But we want to change the
jaw of over cog joint. So choose cog joint, head compile, nothing happened. But if we change
this to 40 degree, for example, head compile. Now, you can see, it's
changing the ya of it, rotation around the zx, right? So no, with this node, we are changing the rotation
of our missile system, but we need to calculate the rotation that it should have so it can face the fighter jet. For doing that, we have our
target over here, right? We can get it inside or
event graph like this. And here, we can create
a begin play because we should access to this BP
radar missile system, right, with event begin play and get
on actor get on in actor, we can cast this on in actor
because we know the owner of this ABP missile system
is ABP radar missile system. So we cast it to BP radar
missile system, right? If this cast succeeded, we can get our BP
radar missile system by promoting it to a variable. No, I want to name it just
BP radar missile system. And inside this BP
radar missile system, I want to get the target, right? Get the target. And we want to right
click on this one, promoted to a variable as well. That's it. Now we have access to our radar missile system
and the target as well. No, next thing that we
want to do in here. We don't need this
trig pawn owner. No, first thing first, we want to check if this BP
GBP radar missile system is valid or not,
is valid, right? If it is valid, next, we want to check if this
target is valid or not. So we check is valid
on this one as well. We should make sure both
of these are valid, right? And no first thing
that we want to get is the rotation that over missile system has
with the target. So this is our missile system, and this is our target. This rotation that it has, we want to find that and how we can find that
there is a node that is called find Look
rotation, right? So it will find the rotation that it's between start
and target location. It will find the
rotation between them. So this node is
really handy, right? The start location is the location of over
radar missile system. So we get the radar missile
system, word location, get word location of it
of the skeletal mesh, right, and connected
to the start. Let me make some space. But the target point is
or target over here. So let's just get the target
and get the actor location. This get actor
location will give us the word location
of over actor, right? Let's just put it over here. This is or target. So now with that this
node will give us the rotation from our
radar missile system to the target, right? This is that rotation, right? But we want to get
the Delta rotator. For example, let's say this
is our missile system, and this is the rotation
toward the target, right? And what we need to happen, we need to change the rotation
of our radar system to this rotation that it has toward the target
location, right? So how we can do that, there is a node that is
called Delta rotator. So it will give
us the difference between the two rotator, rotation of our radar missile and rotation that it
should have, right? The rotation that it should
have is this rotation that is between the missile
system and the target. But the rotation
that it has already, we can get it we get in the
BP radar missile system and get word rotation of
our skeletal mesh, right? Just like that. Let's just put it over here. And connect it like this. So this delta rotator will give us the difference
between the rotation that our missile system
currently has with the rotation that it should have toward the target, right? Now, with that done, we can break this Delta rotator, so we have access to the Yovt. This ya is important because
we change the rotation of this missile system based on this Ya rotation
around the Z axis. Right click on it
promoted to a variable, and I want to call
it missile system. Rotation, right? Miside system, rotation, and I want to connect
the execution, pin to it, if it is valid like
this and put it over here. And no with that done, we can go to anim
graph and connect this missile system rotation to rotation Z or Ya
right? Headcmpile. Nothing will happen.
Don't worry about this. Now if we go to our
level and Runo game, you can see our missile system is looking at the fighter jet. If you go forward, you can see, it's changing its
rotation because it did find us and
it's looking at us. Let's just see how we
can test it better. If you run away game
and eject from here, we can go up and
just look at it. If you click on fighter jet, you can fit, you can see it will be destroyed, but
don't worry about it. Wherever fighter jet goes, you can see our missile system
is looking at it, right? That's cool. Know the
next step is finished, but no it's time to fire a
missile at a fighter jet. Let's see, we can do that next
77. 74 Sam missile: Our radar lock on a target on our F Aighteen and let the missile system
knows about that F 18. But no, it's time to
shoot at that target, shoot at our fighter jet
with our missile system. For doing that, we
need a missile with a projectile because we done
it for our fighter jet, we can just copy and paste
and use that and change the skeletal mesh in that
because it's exactly the same. So go to fighter jet, go to blueprint, and in here, duplicate this BP
missile with Control D, and I want to call
it SM missile, SM is for surface
to air missile. That's why we call it SAM. No, I want to dragon
up and put it in blueprint folder of SM folder, move it there, the duplicated
one, and go there, right? No double click
on it to open it. There are some things in
here that we don't need. For example, this rotation
we don't need, right? This camera we don't need. This spring arm, we
don't need it, right? This skeletal, we
don't need it, right? What we need, we need
just a aesthetic mesh. Just put aesthetic mesh. The static mesh that I want
to use is a a tri missile. Let me go here so you
can see it better. No, this es static mesh, I wanted to be a root, this. And the Niagara, I wanted to
be a child of static mesh, and the audio I
wanted to be a child of static mesh, as well. That's it. Just
like that, right? No, we need to position
the Niagara correctly. Right now, it's facing the wrong way because
it is a static mesh. It doesn't have any
bones inside it. We can just put it
wherever we want, right? So in here first,
let's just rotate a 180 degree and reposition it like this to left a
little bit up like this. Let's just go here to see
if it's good or not, yes, the position in no is good, and our missile is ready, but we want to add
some stuff to it. For example, in here, when the projectile stop, we want to apply some damage to whatever that this missile head. How we can do it, it's easy. We can just say apply
damage. That's it. And we need to tell it
which actor to be damaged. We can get that with
the head actor, the actor that we hit, right, that in this
case, at most cases, it will be the fighter jet
but if it hit the ground, it will try to apply
damage to the ground, but because the ground
doesn't have any help, so it won't be decrease, right? But if it hit the fighter jet because it has aploid damage, it will apply some damage to that actor that it's
hitting, right? It need a base damage as well. Just put ten, for example, for no there, and that's it. Next thing that I want to do. I want to click on our
projectile movement. I don't want to change anything. I just want to go
here and change the homing acceleration
magnitude to something that not too much. If we increase it a lot, it always hit us, right? So we need to put a value
like 40,000 in here. So sometimes we can maneuver
around this missile, right? So the game will be easier. You can play with this value until you reach the
result that you want. If you want a harder game, you can increase this, right? No, next thing that I want
to do, I want to say, if after 5 seconds, this missile didn't
hit anything, make it explode, right? And how we can do that whenever
the begin play happen, what it will do, it will first check if the target is valid. It will set it as home in
target missile, right? But I want to do
something else, as well. So let me grab all of these
and add a sequence in here because whenever
this missile get to be created or a spawned. We want to destroy it after 5 seconds if it didn't
hit anything, right? So in here, I want to set a
set timer by event, right? And after five
second, for example, that we can call this
missile lifetime, right? So we can just drag
and drop promoted to variable Missile lifetime. And head compile, I want
to put it on five for now, but we can change it later. We don't want it to loop at all. But whenever these
five second pass, what we want to happen, we
want to create a custom event. I want to call it
explode, right? Explode. And what
we want to happen, we want all of these to happen. So it will be destroyed. Let me create some
space in here. We want to have explosion, some sound, and
destroy it, as well. So we can just copy all of
these paste it over here, and with that, we are
creating an explosion. This explosion needs a location, and this sound needs a location. So how we can do that, we can get the actor
location for that, right? We can just connect it to here and for the sound as
well. And that's it. After 5 seconds, this
missile should be destroyed. But for testing that, I want to click on Missile Lifetime and put it on two or three
so we can test the tote. If we had compiled go to level. What I want to do,
I want to grab one of these missiles like this, rotate it up, bring
it up a little bit. We can rotate it a
little bit more. Now, if you run over
game after 2 seconds, it should be destroyed. And you can see that after 2
seconds, it got destroyed. But the value that
we want to put for this missile lifetime, I want it to be five. Give it 5 seconds
to hit the target, but if it can't, it
will be destroyed. You need to change
this value later. For no it's just for testing.
78. 75 Fire sam missile: Now let's see how we can fire a missile at our fighter jet. For doing that, let me
show something to you. We have some system. Let me open it so
I can show it to you the BP radar
missile system, right? In here, where we are
getting the target. We are getting the target with this set missile
target event, right? We don't need this
printsing, right? So in here, we get
the target, right? In here, we don't want to fire over four missile at
the same time, right? So we need a timer. So we shoot this missile
every 5 seconds, three second or whatever, right? So in here, whenever we get the target inside this
radar missile system, we want to set a
timer again, right? Set timer by event. Let's say, after 5 seconds, we want something
to happen, right? And with this event, we can create a custom
event and we can call it Fire missile, right? We need to enable
the looping, right? So it will happen until this four missile is fired and we don't
want to reload them. Each five second, this
event will happen. And in here, first thing
that we want to check, we want to check if
the target is valid. So we say is valid, right? And connect it like this. If it is valid, no, we want to check which
missile is available, right? So let's just start with M one. With one, we check
the visibility. Is visible or get visible, right? Both of them will work. So we check with a
branch if the target is valid and the M one is visible. It means we can shoot
this one, right? But how we can shoot it, we can use a spawn
actor from a class. And the class that you want
to use has missile inside it. It's called BPSM Missile. The one that we create together. No for spawn transform. Again, we can get the M one, this case and get word
Transform, right? Get word transform of over
N one, and that's it. We can connect it to
a span transform. And for the collision handling, I want to say always a
spa Ignore collision. That's it. No, I
need the target. Target is valid, and we can
just pass it to it, right? That's it. That's
all we need to do. Let's just test that too. Let me change the
position of player start, so it won't shoot
at us right away. And with position in that I want to delete
this missile as well. No, let's just run again. No, you can see it won't shoot at us because it doesn't
have any target, but if we go forward, let's just see what will happen.
There will be a problem. You go here, you can
see, No, it find us, and you can see it
did shoot at us, but it got destroyed right away. You can see every 5 seconds it's shooting at us. You can see it. Every 5 seconds,
it's shooting at us, but it get a collision
with itself, and it will be destroyed. So it find the target, I shoot at us, but it get destroyed by itself. Let's see how we can fix that.
79. 76 Sam system collisions: Now let's see what
is the problem. The missile is fired, but it hit itself. Let's just go to
it and look at it. You can see we spawn a missile exactly at this
rotation and location, right? So it will hurt itself. We say ignore collision, but it did hit itself, right? It will spawn, but it will
be destroyed right away. So let's see how
we can fix that. For fixing that, let's
see what is the problem. If we go to our BPS
missile in here, if we create some space
in here a little bit, it's just for showing you
what is wrong, right? So in here, we are
hitting something and the projectile stop
right away, right? So what I want to do I want to use a printer string in here, right, and show the
head actor name. Get display name, okay? Compile. Now, let's
just go forward, see what it's hitting, right? We go forward until you
find us, that's it. You can see, it's hitting
the radar missile system, so it's hitting
the system itself. So let's see how
we can fix that. For fixing that, I
want to go to Edit, go to project setting, and let me put it over here. On to go to collision, we need to create
some object channel. First, for missile and after that for missile
system, right? So in here, click on
New Object channel, and I want to call
this one S missile. And we need to
create another one. This time, I want to
call it some system. Okay? So system and
some missile, right? No, with that, we have
some presets, right? Like block hole, overlap
hole and all of that, right? No, we want to add
some more stuff. For example, let's
just click on New. We want to create
one for some system. So put some system for its name. And we want to enable
the collision because we should we should be able to shoot at it
and destroy it, right? So collision enable
the object toy because it is sum system. Let's just put sum
system there, right? And we need this sum system
to block everything, but ignore the Sam missile, right? Makes sense, right? Hetcet no we need to create
another one for some missile. Put S missile for the name. Again, we want to
enable the collision, so it can hit anything
the object type, we want to put it on S missile and we want to block everything. But the S missile
and some system. We want to ignore the other
Sun missiles and some system. Head accept, and that's it. Now, we can go to our
radar missile system, select over skeletal mesh, and in here, this is
our missile system. So we need to change
the collision preset to some system,
but it's not there. The reason that it's
not there sometime, you need to just close it, make sure you save everything, and open it up again. And know if you click
on Skeletal mesh, go down and click on
collision preset in here, no you can see it in here. This is our SAM system. So I will put S system there, and I'll do it for all of the missiles that
is there, right? So select all of them and change it to some system, right? That's it. Whatever
that is inside this radial missile system
should be SM system. No, let's just do it
for some missile. Don't click on it to open it. The static mesh. No, we should go to
collision section and change it to some missile. No, let's just tale. If you're on over game,
there will be a problem. You can see this big sphere. It is colliding
with the missile. So let's just see
what will happen. It did find us,
and you can see it is spawning it outside this
sphere and destroy it there. You can see it. It's
destroying it there. So what we need to do we
need to go to our radar. Let me find our P radar. And this biggest sphere, we need to change its collision. It says overlap all dynamic, but we want to say
overlap everything. And right now it is blocking the new profile
that we creating here. You can see some missile
and some system. So we need to fix
that. For overlap, click on it and tell it to overlap these two as well
or ignore them, right? Heat accept, and we need
to do it for BP radar. In here, we want to
change it to overlap O, and we need to do it
for F 18 as well. So go to Blueprint. Feighteen we have a
big box collision. We need to change the
collision preset to overlap everything because we are just using
overlapping of it, right? So that's it. Now, let's just
test that it one more time. We go forward to see
what will happen. And now, you can see it
is hitting us, right? Again, let's just by a second. You can see it is hitting us, and that's beautiful. That's really beautiful.
80. 77 Missile system bug fix: No one problem that
occurs in here. Let's see. In here, I want to run over game. Let's just go inside it. Slowly go inside it. I don't want to go fast. So I will use some braking
so it won't go into the sky. You can see the missile
system is not looking at us. It's trying to hit us, but it's not looking at
us. Why it's happening. If we go to ABP missile system, you can see we are getting the target at the
beginning, right? And we are not getting
it after that, so it won't happen. So how we can fix that we need
to just delete these two. This is just a big.
How I want to do it, I want to get the
target from here. So search for Target, get the target from here and
check if it is valid or not. In here, we are using
target variable. But again, I want to get the target from our
radar missile system. So it will be always updated. This is a bug that we
fix it really easy. Now with that done, we don't need this variable, we can just delete it, head
compile and run over game. No, if you go forward slowly, don't go to the sky. You don't need to do that. So write a little bit. No, let's just see if
it looking at that now, you can see it's facing us. So that's working good. No for problem is fixed. But another problem that we
have the missiles go away, but it's not making it hidden. So I want to give you
this as a challenge. In our radar missile
system, we are checking. If it is visible, fire it, but we didn't make it invisible. It was just for testing, but no, we want to make it invisible
and shoot in other ones. So you try to do that, and we will do it in next video.
81. 78 destroy fighter jet: No, the missile can
hit the fighter jet, but it's not destroying it. Let's see how we can
destroy our fighter jet. For doing that, I
want to go to BPF 18, and in here, let's see
where we are destroying it. When the G force is
getting more than ten, we are destroying the
fighter jet, right? And you can see all
of this will happen. Know what I want to do. You remember in
the BPSM missile, when we hit something, we
apply a damage by ten, right? We can get that event. How we can get it, we can say
event, any damage, right? So if we are using
applied damage, this event, any
damage will happen. And with that,
whenever it happened, we can destroy the jet just
by connecting it like this. I will create a explosion, it will have a sound, I will turn off the engine. I will do everything for us. No, let's just say
stato if we run a game, so go forward, go to the sky, so it can hit us, right? No, it did find us. Let's see if it can hit us. And now you can see
it did hit us, right? So that's good. But we want to restart the game when
we are destroyed. How we can do it after destroying the
fighter jet in here, we can set a timer like this
set a timer by event, right? For example, after three
second that we got destroyed, we want to create a custom
event, custom event. And I want to say
reset game, right? So after three second, this event will happen, and we want to open up
over level again, restart. Open level by name. The name is New Map. Let's just put it
there. New Map. That's it. This is our level. We can reload it. Now, if you run over game, let's just go forward
again. And go up. If the find us, it will be create us and the dust after 3
seconds, it did reload. So that is working fine. Know about the main issue. The main issue is that in
our BP radar missile system, we are shooting just the NO. What we want to do
after shooting the NO, we want to make
the MO invisible. So get the MO and set
the visibility, right? To headnNw visibility to
false or head den, right? Now with that done, if we run or game, like we shoot us once because we are checking just M one
and that is a problem. We need to add two ent and four as well.
Let's just wait on. It didn't hit us this time, blow up a little bit. We are hovering right now. You can see it's not hurting us anymore because it
doesn't have any missile. Let's just go down
and look at it. You can see, one of
the missiles is fired, so that's good, and
it will reload. Now, we want to create a
system missile system for our radar missile system to shoot and two and
three and four. You try to do that. We will
do it next video together.
82. 79 fire all missiels: No for firing other missiles. Let's see how we can do that. In here, we check if
the M one is invisible, it means we did shoot the M one. So in this case, we want
to check the two, right? We don't need to do one by one. We can just copy and
paste all of this, right? We need to use copy
and paste a lot. So in this case, if the one is not visible, so we can't shoot it, we should go to two. So all of this one, we want to change it to
two like this here two. The target is the
same and in here two. That's it. We need to do it one, two time more in here
for three and four. Of course, again,
we can use arrays, but I don't want to make
it hard for beginners. So, this one is for t. So let's just do the
entry and tree in here. No, this one is for
four and four and four. No, it will shoot at
us four time, right? No, for testing that, I want to go to our
level and get our player start again and bring it
inside in here, right? At F, so you can see it better. If I go like this, if I run, you can see, I will shoot the first
one, look at it. That's it. No, it will
shoot the second one. It can't hit us because it. No, the two is gone. After that three will happen. That's it. And after that
M four will happen, right? Cool. No, all of the missiles
is firing successfully. Next thing that we
want to do we want to be able to destroy
the missile system. Let's see how we can do that. Next video. It can be
a challenge for you.
83. 80 Destroy missile system: So for destroying Sam
system, how we can do that. For doing that, we need to
go BP radar missile system, click on or skeletal measure
or radar missile system, and add the tag in here, right? Add the tag of target. So we can target it, right? Just with that. That's more than enough, right? Let's just go to our level, bring back the fighter jet, run. Now, you can see we are switching between
these two targets. That's it. Just adding a tag. But right now, if you shoot
at it, nothing will happen. Let's go forward. You can
see nothing is happening. So that is a problem. For destroying our radar system, again, we need to
do the same thing. We feel for damaged radar. So let's just right click. Go to Blueprint
of type of actor, and I want to call it P
damaged missile system. D click on it to
open it in here. We need to add a static mesh
first and put it over here. And the static mesh is called
SMEs ASA tree damaged. You can see it over here.
This is the damaged one. There is three of those tracks, and that looks good, right? So we need to add a
no graphic as well. So add a no graphic. That's it. And the one that
you want to use is NSA SAT damaged, and that's it. We did create it successfully. No, if we go to BP
radar Missile System, what we need to do,
let me close this tag. We want to click on
or skeletal mesh, and go to collision
section in here until it to simulate
generate hit event, right? So do that. Now with that done. If we go down, we have
a uncomponent hit. Create that. If
something hitting this, we want to spawn
actor from class, the actor that we want
to create is called BP, damaged missile system. The transform, we can
get the actor transform, get actor transformed.
That's more than enough. And after that, we can destroy this missile system completely. Okay? Now, let's just that out. If we run over game, go forward. To go up and shoot. And now, you can
see if I go there, you can see it is destroyed. Let's just destroy
the radar as well. Like. And the stock. So you can see both of
them are destroying, and you can see this
more clearly, right? Everything cool. You can see both of them are
destroyed and looking good. And I have a maneuver there. I think that looks good, right? So now we are destroying both radar and the
missile system. We can populate our map with these radar
and missile system.