Transcripts
1. Why Should YOU Watch This Course?: Have you been a victim of a bad on the real course where
your instructor just goes on and on and
building a game on the screen and you're not
understanding what he's doing, getting 0 explanation and being expected to just follow along. And the worst part is, at the end of it, you might have a working game, but you have no clue how
the heck you even did it, because all you really
did was watch and copy. If the answer is yes, then you've come to
the right place. My name is Michael Moore, founder of bubble and game dev. And my goal is to
make you the best game developer and the
most fun way possible. I have developed a strategy
that has helped thousands of aspiring game developers achieve their goals of creating
real-world games. And I wanted to do
the same for you. If I've learned, is that it can be very difficult
to know where to start and what steps to take to go from beginner
to intermediate, to professionals, not
only in game development, but in programming and
mastering the Unreal Engine. And this is where the
strategy comes in. We'll start off by learning the very fundamentals
and the Unreal Engine. Each section is dedicated
to a certain area where we delve deeper than
any other course into a great aspect of unreal. This allows us to
fill the foundations. And on those foundations
we are going to create our main game project, which is Cyprus, fine. So how are we going to do this? In sections 23, we are going to learn the unreal
architecture. We'll learn what
the viewport is, how to navigate it effectively, how to add actors, change materials, and
how lighting works. Then in section four, we use what we've learned to create and set up
our cyber spy world. Section five, we introduce
blueprint visual scripting. And unlike other courses where they just stopped immediately, we take our time improperly dissect and understand
what nodes are, how they are connected,
how they flow, and the amazing things
timelines allow us to create. Then we jump back to
our main game is to section six where we
create moving platforms, pressure plates and
flaming find enemies. So what should you expect
by the end of the scores? You'll become a master
problem-solver. You'll understand
the fundamentals of the Unreal Engine and you'll
learn how to create games, just like the ones you're
seeing on the screen right now. You'll also have the chance to flex your game developer muscles because with every
video there is a mini challenge for you too. And even if you can't figure
out how to do the challenge, Don't worry about it. I will be there to
help you after you try and complete the
challenge with you, everything in our game is
going to be configurable. So you can tweak, play around and
give the game and individual and special
feel about it. So you'll be putting
your own creativity into it and really
making it your own. I am so excited to get
started. Hope you are too. This is the perfect time to start learning how
to dive in with me and I will help
you along every single step of your game
development journey.
2. How To Use This Course: Oh, okay, so in this video, I wanted to start off
by saying, welcome. Congratulations. Thank you so much for
getting the course. Thank you so much for
choosing to watch the scores. I'm very excited to get started. I wanted to just talk about
how you can navigate through the scores in order to get
the maximum value out of it. So I'm going to start with
a simple thing which is the Q&A tool you've already seen as my mistake
clicked on it. While you're
watching the course, maybe you stumble upon something that should
don't quite understand, even though I tried
to explain everything extensively and delve as much as I possibly can into details. You never know, sometimes
I might miss something, sometimes I might not
go into too much detail into something that you might
feel needs more detail. Maybe I did something, I didn't realize that something
might be hard for you. You can always use
the Q&A and here, a couple of rules before
you actually do do that, before you ask a question. First of all, look through the
discussions and see if you have somebody else has already asked the questions that you've asked
a lot of times. That is the case, might
be one thing to ask a question that somebody has already asked and
we've already solved. This will save me a bit of time, and it will also save
you a bit of time. I usually reply within the 24 hours because of the
difference in the time, and I'm not always
in the Q&A MC. I have a track record of always 100% Answering everyone,
everyone, everyone. Maybe I've missed once or
twice, a couple of people. I'm not sure, but I
always always everyday, I open up in the morning
and I see the Q&A, I see what students
have asked me, so I always reply. But one thing to keep in mind is if I do solve your problem. And actually when I
thought solve a problem. Or if you've asked the question and then
you solve the problem, go back and edit your question and write
a solved over it. This will help me out. This will help
other people out as well that also are looking
through the Q and A's. So think about yourself. It's actually very helpful because if somebody else does it for you and you'll find the solution immediately
with assault, you then immediately know, oh, okay, so the question is solved. Let's look through
it. Instead of keep asking asking the
question again, we think for me to reply. So with that out of the
way, let's continue on. Next. Let's talk about
the Discord server. I have a huge
discord server with, I think about right now
we're at 400 students, like-minded students that
love Game Development, that love and real love in C plus plus and all
of these things. So make sure that you go there, that you ask questions there, that you show off
your game there, you have unlimited ability to do whatever you
want in there. So go ahead trying
to Discord server, show off your game
and help out others. Sometimes when you
help somebody out, it actually increases
your skills because when you teach
something to somebody, you understand what you are providing for
that person more. Your brain needs to dissect the information that should
have and the ideas needs to be properly prepared
in order to teach somebody or help somebody with a problem. Solve. There we go. Let's talk about the
challenge slides. And this is something
that I feel is very unique to the
scores and it's very different than any
other course that I can see on the unreal. So this is your challenge slide. When you see the slide, pause the video and do
the challenge on it. Whenever I'm working, maybe at the end of the
video, maybe in the middle. You never know, it's a surprise. You always have to
be on your toes and vigilant because I always
create this challenge. And why do I like to
create this challenge? Because it's a much
better way to learn. Because I've been a student
and I've watched courses. And I honestly hated sitting there and
doing nothing and just watching somebody
just coding code and endlessly park
and talk and talk. I don't want this to be the case in my videos,
in my courses, I want to get your hands
dirty and try things out. And the most important
thing, always, always tried to do your best, never just take this challenges. Yeah, let's just get
over with not always. Pause the video, try your best. Don't worry about
that. I always go back and I do have a
challenge with you. I never leave you hanging. I always rule the challenge. This is very helpful. It will help you. First of all, two
things on your own, which is very important. Second of all, if you
fail, that's great. That's amazing because
once you fail and you see the solution,
it's much better. It clicks and it becomes
concrete in your head. You now understand that
much better because you failed and now you
know how itself, but you don't even try. You will never
know that you can. Whereas your problem if you've
never tried and failed. So I recommend that you always, always do the challenge. Always doing as much rather than watching this as
my model in life. Let's continue on. Let's talk about the
course structure that we have in section one, which are already
watching right now we have the introduction
we will talk about, about Unreal downloading it and we'll create our first game. Next, we're going to build a virtual world and
the level editor, this is where we are going
to talk about the viewports, talk about the different panels, talk about the world
and just get familiar with Unreal and how to
now navigate through it. We're going to talk about
the unreal architecture, where we're going to discuss
what the static meshes are, what materials are, how
to light the environment, what are components in the actors and all
of that good stuff. Next, we'll have a section
for the cyber spy. So this is the main game
that we're creating. We are learning unreal and
dissecting it bit by bit, understanding every single
little tweak that we need. And we're also keeping things fun by
creating a nice game. And each section will
use everything that we've learned and put
it inside of our game. We are going to build our world by creating
the lightning, creating our first level, and loading the
inner structures. Then we have the blueprint
visual scripting, which is personally
my favorite section. Maybe I don't know,
because here we will learn above the blueprint,
visual scripting. Obviously, we're going to
learn about functions, flow control, timelines,
the variables, all of that good stuff. And then we'll use
all of them in order to create a
moving platform, activating this platform and using timelines to
create enemies. Then we're going to move
on to the next section, which is Section seven, which is making an
interactive experience where we will talk about
what a character is, what they found is what a player controller and
what an input and what they gained more than
all of these things that make the world interactive. And obviously then
we'll be using them to create our character, will be making our character
jump in a certain way, rung in a certain way, and we'll adjust its movements so we can jump
higher, jump lower. And this is where your
personalized touch will come in. You will decide how high
should the player jump? How long should he
stay in the year? How much control does
it need to have an ear? Then we'll move on to
physics collisions. We will talk about how
collisions work and unreal and just understand
how everything works, how the physics
interacted unreal. And in here also we'll
talk about damaging real, which is very helpful
because next, we're going to be adding
physics to the player by making him be able to
interact with the environment, get damaged, or create spikes, will create gems that
we need to collect throughout the level in
order to finish the game. Then we'll have all your obviously what game
doesn't have audio. We'll learn about
how to add audio, how to play it, how to stop it, how to make sound effects whenever we get to hurt
or we pick up something. And then obviously again, we will be adding
it to our game. Then we are going in the
last three sections, or actually the last two
sections are going to be about the
graphical interface, which is called the
UMG or unreal motion graphics motion means we
can animate those things. We'll talk about Flexbox
animations, widgets, buttons, all of that good stuff in order to display our health. Display, how much gems
that we picked up, display whatever you want. We'll obviously be adding
it to our players hot. And the last level in the last section is
about adding levels, where we will talk
about level design. We will talk about setting
up the environments and what it takes to create
very fun in levels. How to make them fun, how to make interactive level of how to progress
through levels, because we will have
so many components by the end of this course, we will have so many objects
to play around with, from spikes to jams, two big spikes or
small spikes to enemies flying around to so much things and
moving platform. So how are we going to structure our game to progress
through the levels? This section, we'll cover all
of these and we'll create, I think about six or seven or eight or ten levels,
whatever you want. Finally, I wanted to talk
about something which is very important to me and I think you need
to keep in mind, and that is to watch the
course until the end. The problem was more
students is that they get about 1 third of the way and then they
stop and some of them get half of the way and
then they stop. They stop. And for me that's very bad
because sometimes you don't really get to the third
of the course and you're not sure what you did
and you feel the motivated, but because you still haven't understood everything
and you quit, That's a very bad idea because most of the time whenever you start to feel very confident. But as you start learning, your confidence
starts to go down. Why? Because as you expand and
you see everything around, you start feeling that
the more you learn, the more you understand
what you don't know, and the more you
need to learn and slowly but surely
this feeling can creep up a new and gets you
motivated and feeling like, yeah, I'm not worthy
understanding unreal. And I was in that position also, even though I had
several years of experience in game development
when I started on real, several years ago, I really felt overwhelmed because
everything was so new, so complicated the
huge, huge engine. But trust the
process, keep going, keep pushing and
make sure that you watch till the end
because you'll notice once you get to the end and you have your
own game and you understand every single window and what it does
and how it works, you'll feel much more comfortable moving
to the next level, which is the professional level. You will feel more
comfortable using, know what's going on or
if you watch something or somebody talks about
something, you'll know. All right, I've watched this. I didn't quite understand
it at the beginning, but because I
watched till the end and I've done much
more difficult things. The thing that I didn't
understand now seems much easier. So this is my final message. I hope you have fun
during the scores. I hope you enjoy. Keep in mind, always asked questions,
don't worry about it. There are no stupid
or dumb questions. I'm always here to help. That's it. That's it. Let's move
on to the next video. I'll see you then.
3. Downloading Unreal Engine 5: Oh, okay, So now it's time
to take the first step in our game development journey and an hour Unreal Engine
five development journey. We're going to download
the Unreal Engine. So what we're going
to do is we're going to go to our trusty
friend Google in here. We're simply going to
type in Unreal Engine. Once you have the results, you simply go to the Unreal
Engine.com or you can simply just go to the Unreal
Engine.com. I don't know. I have this quirk of
always using Google. In here in the Unreal Engine, you'll be prompted with
this cool-looking video. And this is the video or
the game that has been created as a test on
the Unreal Engine five, you can actually try
and play it and see the full scope of what you
can create and the engine. But for now, all
that we need to do is we need to click on
this Download button. Once clicked, you will be prompted to this
screen right here. Simply scroll down and download
the publishing licence. There are a lot of differences. We're not going to go
too deep into that. But all that we need
to know is that the publishing licence
is what is required. Simply click on Download and
download of the Epic Game. Launcher will be started. And you might be asking, why aren't we downloading the
Unreal Engine immediately? Why are we, why do we require
the Epic Games launcher? Well, if you know the
Epic Games launcher, it's the parent company
of the Unreal Engine. It's the owner of
the Unreal Engine. We'll talk about what the outer conduction
convection there is. If you know what Epic Games are, they are the creators of a very, not very popular game
called for type. Maybe you've heard of it. It was made on the
Unreal Engine. And they also have this marketplace where you can download games similar to steam. So on that you can
download games, you can play them
similar to for tight. And you can also download the Unreal Engine and use that
to create your own games. So once you download it, you'll be prompted to
the screen right here, where you will require
to sign in or sign up. If it's your first time. Obviously you only
need to sign up. You can either sign up using
the Epic Games account, create a new account, or you can simply sine
n using Facebook, we will whatever you want, even steam if you want, which is kind of ironic since
they are in a competition. So sine n sign up
using any email or any form of signing in here that you
want. It's very easy. All we have to do, just use your account on one of these or simply sign up with
your name and an email. And you'll get verification
and all of that good stuff. Once you're finished,
you'll be taken to a screen that is
similar to this one. If you look around here, you can see that you have the news where you can look for news about
the Unreal Engine. Now you might think that
this is kind of stupid, but trust me, if you
look around here, you can find very nice
stuff that might help you or at least give you an idea of what kind of game
you can create. Next you have the samples. These are also very important where you can
download, for example, the matrix that you saw in a couple of videos you
can download and play that you can download
a car and configure it and play around or drive around. But the most important
place is the marketplace. Well, the second most important
place as the marketplace, where you can download and
get some amazing cool, free and paid assets. And you'll notice that some
of these assets are free, but not all of them
are free forever. So for example, you can
see three for this month. It can simply just get them
this month, next month. They won't be available. Back in the library, which is the most
important part. And this is where you
will be downloading your Unreal Engine versions. And you will see all of
the projects and all of the assets that
you've got anterior, you'll see the versions of the Unreal Engine that you
are going to download. Now, I recommend
that you download the latest version of Unreal
Engine four because you can use the Unreal Engine
four to get some of the assets that are still not available on the
Unreal Engine five. And once you get these, you can then convert them
onto Unreal Engine five. Anyways, if you don't want to download the fort,
don't download it. You can immediately download
the Unreal Engine five. You can see right here we
have this little plus button. Once it's, sometimes
it's great, grayed out. If it is just simply open up a new account or use
a different account, it will show up this
as some kind of bug. I don't know why it
keeps popping up. This is why I have
an extra one here, always ready for these
kinds of things. Download the latest
version of Unreal five. If it's newer than
the version I'm using most probably
it's going to be 99.9% exactly the same. There are a couple of changes. It will most likely
be with the UI or with a couple of bugs that
might happen with me, that won't happen in your case. Simply just be a bit vigilant
when looking at this. If there is a huge difference, most probably you can
most probably somebody or you can leave in the
discussion or in the Q&A. Just a small reminder, I will update the course, make sure that everything
is up-to-date. But I almost well, almost meaning 99.9% guarantee that there will be a
very small difference. Now, with all of
that out of the way, it's time for your
first challenge. Your challenge is to
download unreal and set up. First of all, download
the Epic Games launcher, just like we talked about. Look around, see what
things you have. So look around the
marketplace, checkout, the library's different things, just go through it. A font, no worries. Download the Unreal Engine
five, like I told you, and set everything up next and move to the next
video so we don't waste any more time
and we talk about the Unreal Engine five and
start creating our first game. I'm so excited to see
you in just a bit. But before I leave, I just wanted to ask you
a small little favor. You might be asked right
now to leave a review. Please don't do this
without any concern because it affects me a lot
if you just leave a one star, two star, three star review, just for the sake of
getting rid of the screen, it will affect me a lot. It will take down my course, it will hurt my representation
on the platform a lot. So please, if you don't want
to leave a review right now, just move on through the
course and whenever you feel I deserve a review, leave it then if not, if you think that
I observed with lifestyle review based on
what you saw right now, Go ahead, please be my guest. But I recommend that you
watch just a little bit, but if you want, I'm
not going to stop you. Just take your time. Don't be hasty. Just
leave a minute. Don't do it without thinking because it has a
huge effect on me, even if you think
that it doesn't. Thank you so much for
thinking about me. Thank you for being empathetic. And let's move on. Let's move on to the next video. Just as I promised.
4. Unreal Engine 101: Okay, So in this video, we'll just talk about the
Unreal Engine origins. The unreal origin because it's
a very fun story and we'll talk about the gains
that have been created on the Unreal Engine. That way you'll get
more excited and you'll feel that you're actually
learning something, a platform that
has the potential to create incredible games. Let's get started. First of all, the unreal,
not Unreal Engine. And Unreal was a game created by a big games or it was
called Epic mega games. It was published in 1998. It was powered by
the Unreal Engine, an original game engine
created by Epic Games. This game reached a sales of
1.5 million units by 2002, which is pretty
impressive by that time. And those times, 1.5 million
was one heck of a number, especially on PC gaming. So since the release
of the unreal, the franchise has
had one SQL and two different series based
on the unreal universe. That was before the Avengers, Avengers universe and this
new universe and whatever, so late this generation is
the Unreal Engine five, which was launched
very recently. Well, depends on when you're
watching the scores during April 2020 to its predecessor
released in March 2014, which was the unreal
for obviously. And it's source code
is available on GitHub after
registering an account and commercial commercial use is granted based on
a royalty model. And I'm not sure if I've already explained what they
royalty model is. It means that you can keep
playing or keep using the Unreal Engine
until your game makes around $1
million in revenue, then Epic Games will start charging you a
little percentage for it. But I'm sure at this point you won't need
to worry about that. Try for us to actually
release one of your games. And if you make 1 million, I think that it's only fair to pay on real little bit of money. Let's talk about the
Unreal Engine origin. First of all, we have the first-generation
unreal engine that was developed by a guy
named Tim Sweeney. Now, we need to talk
about this legendary guy, according to an interview,
is swinging road. 90% of the code in the engine, including the graphics, the
tools, and the networking. Not only that, his
age is undetermined, so we're not sure if
his age is 51 or 52. This guy is one
**** of a legend. I don't know. I just loved people like these, these characters outliner is, I'm sure he's one of the
unspoken heroes of his era. Nobody knows who he is. Everybody. Millions of people have played amazing games,
have amazing games, create amazing
games, made millions and millions because
of this guys, um, I don't know, crazy mine. He created 90% of the
code for the engine. So I just wanted to mention him. The while it cost around $3
million to produce a license, usually they were giving
these licenses to game developers for
around $350 thousand. So I think pretty much they
made all of their money. Now, one of the best games developed for the
first generation of the Unreal Engine was the Harry Potter and
the Sorcerer's Stone. So if you know the meme, congratulations if you don't, you probably have alive, unlike me on the others. So I'm this was the first
game, the Sorcerer's Stone. I don't know if you have
any memory of that. If you're not as old as I am, but I loved to play that game. It was amazing and one of the best Harry Potter
or gains to this day. But now let's talk about the new games that are
created and unreal. And some of them you might have heard of if you're
a gamer, if not, you probably have no idea
what I'm talking about, but I doubt that you are not. Again, we have borderlines, all of them bought
the lens, the one, the two, and the three amazing first-person shooter games. We have the madman Arkham City that was also
created on the Unreal Engine. We have BioShock, one of the most amazing
games in my opinion. We have Mass Effect two, also a very good game that I
personally don't know why. I didn't like. We have the job that
the Jedi Fallen Order, a very recent game by a very controversial
company, which is EA. So you can see that once somebody who's uses
the Unreal Engine, they actually come
out with a good game. Then we obviously
have fortnight and we also have player
unknown battlegrounds. Well, you'd be surprised. How does that work? Well, it does, because Unreal
Engine is that amazing. And finally, a news,
I'm not kidding. I had these slides
prepared for over, I don't know, maybe
a month or so. But today I heard a
really good news that the Witcher for I don't know if you've
ever played the Witcher, but it's freaking amazing. And the Witcher four is scheduled to be
released and on a whim, maybe 262026 or
something like that. And it's going to be on
the Unreal Engine five. So if you're learning
Unreal Engine right now, in a couple of years, you'll be among the very leading game
developers in the world. That's why you need to watch
the scores to the end. That's why you have to
learn on Unreal Engine. Understand everything,
grind your teeth. Fail, fail again, try
again, fail again. An order to understand
and learn this engine because this can really take you to the top
and this is my goal. My goal is to just make it the best game developer in
the most fun way possible. I want you to
understand everything. I want you to have fun, and I want to see
how your creativity can be applied to the
modern game development. Because currently games
are starting to go downhill without all
the micro transactions. So hopefully, we can create a better world inhibitor gaming environment
for the future. I will stop my stupid
speech and we'll move on to creating
our first game. Let's not waste anymore time. There are no challenges
and let's continue on.
5. Your First Game: Welcome back, My favorite
game developers. In this video, we've created our first blueprint and Unreal, we didn't create all
of these things. We just created the Launchpad. So now when we play the game, we ran up towards the platform. There we go, you can see
we have an explosion. We have our player
being launched in the year and most of the
work you did yourself. So let's not waste any more
time and let's get started. Okay, so now it's time for
our first game engine. Before we get started, I just want you to
understand something. This video, you'll probably
not know what you're doing. All that you need to do
is just follow my lead, follow the steps that I made, and be sure that as we progress through the
course, everything, everything that you see will be completely explained in detail. But in this video, I just wanted to
show you how we are going to create our first game. Just to get you started, just to get that initial
little fear out of the way, maybe a tool create more field. Who knows? Anyways, let's get started. We'll go into the library. Most probably you have the Unreal Engine
five in here ready, or you have this
option right here. What we're going to
do either click on the Launch year or
click on Launch here. I like this one. Let's
say bigger button. We simply click it and
now it is launching. Okay, So as soon as we
start our Unreal Engine, you'll be prompted
to this window. As you can see, we can create
a new project in here, or we can select a
pre-determined game. We also have the
option to create a film slash video live event. We have the option to create an architecture
engineering construction, and some thing related
to automobiles. But now let's focus on the game. So we're going to
click on the game. We're going to click
on the 3D person. We're going to
keep it blueprint, keep the target platform
desktop quality preset, maximum and the starting content on and make sure that we
don't have ray tracing. This is something that
we will not need and it requires a very strong PC
with amazing qualifications, which I don't have. We're going to create the
project and we're going to call it my first game. You'll notice here you can
select where that is created. I recommend if you have an SSD that you
save it in the SSD, that way it opens up it faster. So once you have everything, hit Create and wait for
the project to be created. I'll see you in just a bit. Okay, so now we are
in the Unreal Engine, bit scary, I know, but let's not worry about that. First of all, what we're
going to do in this game is we're going to create
a small Launchpad. If we hit the play key. There we go. We can
see that we can look around using our mouse. And if we start moving
using the WASD, we can see that we can
also run up things. So this is a testing
for the Unreal Engine. And if you hear a small
in the background, these are the ventilation
system on my PC because unreal isn't
a small program. So now that we are walking
around and we can jump, the next thing we're going
to do is we're going to create a launching platform. Once we step on the platform, we want to go up in the air and you can see how cool
our character looks. This is a third-person
perspective. I'm going to exit. I'm going to click on this little counter drop
content draw right here. Once I open it, I'm
going to right-click in here and create
a Blueprint Class. Blueprint class. We'll have a ton of options that we're
going to talk about, of course later on. But for now we're going
to create an actor. Once clicked on the actor, we will have this
right here and we will be prompted to add a name. I'm going to call it the D p, meaning the blue
print underscore. Launch. Launch pad. Hit Enter, open
up the launchpad. As soon as we start, we have this free key. Things again, will not be
worried about that too much. We're going to click
on these three bars in here and we are going
to show the floor. So now we can see the
floor underneath us. We're going to go
ahead and add a cube. This cube is going to be
called V launch base. Hit Enter. And now we have a
LaunchPad base. Keep in mind, this is
where we add components. This is something
to remember later on for our challenges. So I'll click on Search for
cube and added the cube. Now we have this cube. If we look on the right, you can see that we can change
the scale of this cube. I'm going to scale it down on the z-axis to make it a
bit smaller, thinner. And I'm going to zoom in using the right mouse button and the
WASD and move it up a bit. And then I'm going to click
on the scale and set this two by two by 0.2. When we compile right
here on the top left, I'm going to drag it in here. And if I go back to the level, I'm going to click on the
content and I'm going to drag this back
over to my level. So there we go.
Now when we play, we can see the pad
and our world. And you can see right here
that it's a bit hovering, if you like that,
you can keep it. But honestly, I have a
bit of a thing for this. I never liked to have
anything above ground and for some reason it doesn't seem
like it's some of the ground. Anyway. Let's keep it. No worries. Compile save. Now it's time to add a
bit of functionality. What we're going to
do is we're going to click on the ad in here, and we are going to search
for the box collision. Once clicked, you'll notice that we have this box collision. And if it's under the Launchpad, you can see right here, just unhook it and
leave it in here. So I'm going to move this
LaunchPad up and you'll notice it has a bit of different properties right
here in the details. So I'm going to
increase the size, the X2, 100 on the y to 100. And I'm just going to move
it slightly up that way. So there we go. And maybe you know what, let's make the zed
a bit smaller. So we'll make it just
18 and maybe even less, maybe make it then
that way we will take it down and put it
up on this platform, will compile, we'll save. And now when we have everything, obviously when you look at here, if you go back to the game, when we play, you'll see
that there is no box, even though we've added one. This is because it's
an invisible box, but this box is what
is going to help us do lunch the
player in the air. So I'm going to make sure
I'm clicking the box. I'm going to scroll down
into detail until I find these weird big
the green buttons. I'm going to create
a on begin overlap, which is the second one. Click on the arm begin overlap. And in here I'm going to do
a couple of crazy things. So I'm going to click on the
other actor, drag from here. And I'm going to type in gassed to third
person character. So make sure that it is gas
to third-person character. This is very important
and make sure that it's from the other actor. And if I haven't
talked about it yet, this is where we create our coding and our
blueprint scripting. So deep into this, later on in the course,
I'm very excited, but for now, let's
launch our player. And how do we do that? We're going to jack out of the little pin in
here and we're going to write launch character. It's that easy. Make sure that these
white lines in here connect and this one also. And make sure that we were
using the other actor. And we're using this as
the target for the launch. And now I'm going to set this as 3 thousand on the z axis. Does that excess means we're
going up compile, Save. And now when we go
back into our game, when we hit the play, as I'm walking, if I go into this white cube, there we go. How cool is that? So now we've created our first official launch and we're probably
depth, where are we? So as you can see, we've
created an amazing Launchpad, bit of an overkill on the
launchpad, but that's okay. So what we can do is we can adjust the way our
character is flying. Because as you saw right now, when we jumped, we could
not go back in the air. Well now we can, we have a bit of air control, but maybe we want to have
just a little bit more. Now I'm going to click on
my third-person character. And there we go. You can
see the name right here. You'll also notice that we have a camera attached to
the back of them. That's how we see the
third person view. The details. I'm
going to scroll down and check on the
character movement. This is the properties of the movement that we
have for our character, the walking, the jumping, and all of that good stuff. So I'm going to change
something in here. And that is the air control. And if you can't find it, you think it's
very hard to find, you simply can search
in the details and I'm going to check
for air control. I'm going to increase
this to 0.8. Now when I close
this and I play, we should see that once
we are in the air, I can much better
control my player. You can see that I
can take him all the way to the edge
of the screen. How cool is that? Now with our first
game complete, I'm going to show
you a challenge. Your challenge is going
to be to adjust the game. Play around with the
launch velocity, makes sure to compile. This is very important. And play around with
the character movement of the air control, the air control multiplier, and the gravity scale. Also find out other
options you have there. Use the extreme method. What is the extremes method? Well, let's say I'm in this character movement and I don't know what the
graph the scale does. I just increase it to 221. I hit play. Now I tried to jump.
Why can I jump? Well, because the
gravity scale is so big that I cannot jump. So what I can do
is, for example, go to, let me take
this down to whatever. If you ever find yourself
one thing to reset, you can simply click on this
little arrow that appears. So for example, if I
want to, I don't know, let's say I'm looking
for where does the jump jump jump height. I don't want it to be 600. I wanted to be there we go. 34. I think that it's going
to be a bit too much. So 7 thousand play,
what's happening? Boom, there we go. This is the extremes method. Whenever you don't know what to do with one of the options, simply take it to the
extreme and test it out. And finally, add
a particle system and the components
and in template, in details, select
the explosion. So whereas the here
and the Launchpad, you can go to the components. Let me just stop the game. Go to the components and
add a particle system. Look in the details. Look in the details and find a template and add
the explosion. So pause the video right now
and go do the challenge. Kaye, welcome back. I hope you did the challenge. It was easy. It wasn't that hard of
a challenge, I hope. So. I'm just going to adjust
this because it's too much. 600 is too much. I'm going to add just the air control
from 0.8 to maybe 1.8. I'm going to adjust
the launchpad. Launched character
from 3 thousand to maybe one hundred,
ten hundred. Yeah, So that way, maybe ten hundred,
twelve hundred, maybe, maybe compile, save. And I can also play
the game from here. So when I hit play, I can walk towards this boom. I jump and I can easily
control where are not easily, easily, but I can control
where my player is falling. There we go. We go in here,
everything works fine. Now the next thing we're
going to do in the launchpad, I'm going to add a
particle system. So we add a particle system. We are going to call
it the explosion. If I scroll up in here and
find the template somewhere, you can see right here, I can change this
to an explosion. There we go, compile, save. And now when we play the game, you can see that we've had a bit of an explosion
in front of us, but this is not what we want. We want this explosion to happen when we are launched in the air. I'm going to scroll down in
the particle right here. And I'm going to find
the auto activate and I'm going to turn it
off, Compile, Save. So now when we run the
game, there we go, There is no explosion
on the platform. Now we want that to happen. So what we'll do is we're
going to move this, right. We are going to find the
explosion right here in the variables and drag
it into our world. Once we let go of our mouse, we are going to have the
option to either get or set. We're going to get I'm
going to drag off of this. Not that is called the activate. Activate. It's going to be the first one under Components. Click on that. And now I'm
going to simply check this, check this, move it up a
bit just so we can see. Right here, there we go. Make it a bit more tidy. And now I'm going to
compile, save, compile sake. What's happening in here? As soon as we overlap the box, we check if it's a
third-person character. If it is, we are going to
activate the explosion. And then we are going to
launch our character. It'll compile, save,
play the game. Now when we walk
towards the platform, when we jump on it, there we go, you can see the
explosion happening. Let's do it again. Boom, there we go. You can see the explosion. How cool is that womb,
another explosion? Well, it's probably
not very obvious. So I'm going to go
into the viewport, move it up a bit and maybe just maybe I'll scale it up
on all of the sides. So make the scale
of the explosion to buy two-by-two, compile, save. And now when we
play we should see a boom, a huge explosion. So I hope you
enjoyed this video. I hope you're not too scared
of what's just happened. And if you have the time, please leave me a
review. This point. You've probably been
asked to leave a review. If you'd like what
you see so far, leave me five-star review. It helps me out a lot. Leave a couple of words there. Tell me what you like. Maybe something we don't like
you'd want me to change. You can contact me on Discord, on Instagram, on
whatever you want. I'm always available. Thank you so much for watching and I'll see you
in the next one.
6. Section 2 - Building Virtual Worlds Level Editor - Level Editor: Welcome back, My favorite
game developers. In this video, we'll just have a brief overview of the
different panels that we have. The ones right here,
the World Outliner, the detail, whatever
this one is. So this is just to get our heads around everything
that's happening in here. So we then can delve deeper into every
single one of them. So let's not waste anymore
time and let's get started. Okay, so now let's talk
about the level editor. The level editor
means everything that you see when you are
editing a level. This, for example, when we
were creating a launchpad, is not the level editor. By the way, I don't
know if you've noticed, but we're using the same
interface that we were on, the same project that we were when we were creating
our first became. So if you didn't do that, go back and do game. Anyways, let's talk about the level editor and what it is. The level editor provides the core level
creation functionality for the Unreal editor. You will use it to create
view modify levels. You will modify a level mainly
by placing, transforming, and editing the
various properties of your objects in the world. So let's talk about the various windows
that we see in here. First of all, let's talk about the tambor and the menu bar. The menu bar which
you see right here, should be very familiar
to anyone who has used a Windows
application previously. It provides access to
general tools and commands. For example, you can
create a new level. You can change project
settings in the edit, edit, in the Window tools
built and the help. So very basic things. Next we have the tab bar. So the level editor has
tabs along the top with the same name as the current
level that you are editing. You can see right here
that this is the, if you hover over
it, you can see the third person example map. You can Tab other editor windows next to this
one alongside it. So you can see, for example, when we had the launchpad, we can simply drag it
and put it alongside. Next, let's talk about
the toolbar panel. This displays a
group of commands, and this is the toolbar
panel, the one right here. This displays a group
of commands providing quick access to commonly
used tools and operations, such as creating, playing, and having the various modes
that we can see right here. Next we have the viewport panel. This is your window
into the world's you will be creating
in the Unreal Engine. This is also where you will be editing the various things. And as you saw when we
added the platform, also adding them and
checking how they look. Next we have the Details panel, which is on the bottom
right right here. This is Detail panel contains
the information utilities, and functions for the current
selection in the viewport. So when I select the Launchpad, you'll see that I have all the options of the
launchpad that we've created. If I select the third-person, you'll notice these
details change and now we display the various things
attached to the third person. It contains transform
as it boxes for moving, rotating, and scaling the
actor as we did previously, and displays all the
other editable properties for the selected
actors and provides quick access to additional
editing functionalities depending on the type of actor that you've added
into the viewport. So for example, if you choose
the third-person character, you can see it has
animation, it has meshes, but if you choose, for example, this
stair, there you go. You can see we don't have these animations
or these meshes. Sometimes the detail
option change depending on what you've
selected in the viewport. Next we have the World
Outliner right here. And the World Outliner
panel displays all the actors within the
scene in a hierarchy tree. You can select and
modify actors and directly from the
wall World Outliner. So for example, if I select all ten and look
around, there we go. So this is the wall ten. If I select the ground, you can see that I've
selected the floor. And why is it in a hierarchy? Because for example, we are, we know which is the floor, the walls, and the
various things are inside of the arena. All of them are in a hierarchy. And you can also see
that in other places. For example, if we click on
the launchpad, there we go. We can see that it's the World Outliner and
we can also change it. When I said that we can modify
the actor we can select right here to edit the
blueprint and we open it up. The final thing I
wanted to talk about is the content
browser right here, which you can click down and
up and you can also dock it. We'll talk about that later. This displays all
the content assets contained in your project. This is where you go to create, import and ended
all the contents. So if you remember from our
first game that we created, we right-clicked in here and
created the blueprint class. And then from here we also
added it to our world. So this is where
everything that should do, everything that you add, what almost everything
is available. Now with that out of the way, I'm going to issue you
a small challenge. Your challenge is to
play around and explore. So first of all, explore all the elements we
talked about briefly, then make a mess and
don't worry about it, just play around,
see what you can do. Say, See what you can find. You don't need to understand everything as we'll be delving deeper later on to every single
element that we've seen. And this is just to get
over your fears of Unreal. So I'm just going to do this challenge
right now with you. I'm going to go back in here if you want,
pause the video, do the challenge,
but I just wanted to show what you can do in here. For example, let's say we
can open the starter back. What is the starter content? What do we have in here? The shapes with
all these shapes, let's add a shape. I don't know what's going on. The world outline that. Maybe I won't like
it to be here. Maybe I want to move
it, for example. Nice. We can try that out so it
doesn't look very good. So I'm going to go
ahead and put it back in its place.
So there we go. Just play around, see
what options you have. Just add things, make a mass
tried to ruin the project. Don't worry about it. You can always just click out of it, create a new project, and lead the one that
you've messed up. So go ahead, pause
the video right now. Go explore and I'll see
you in the next video.
7. Editing Modes In Unreal: Welcome back my fellow
game developers to a brand new video. And this one we will
be learning about the various modes that we
have and about lace actors. So as you can see, we've changed things
up and our level, we've added some
kind of scary queue. And when we jump off
the rails, there we go. You can see we are dead. We disappear. So let's not waste any more time and let's
see how we can kill our first victim than
the Unreal Engine case. So in this video, we are going to be talking
about the various modes that we have and then
focusing on one of them. First of all, modes can change the primary behavior of the level editor for
a specific task. And we have all the
modes displayed up here. We have six of them actually. We'll go over all of them quickly and then focus
on the main one. So first of all, we have
the select right here. So the select mode is a specialized tool
for speeding up and simplifying environment
creation and the Unreal Engine. Once the select
mode is selected, you can just choose one
of the objects and just move them around and
edit the world easier. Next we have the landscape, which allows us to add
the landscape terrain. We'll not be talking about landscape and scores,
but as you can see, this creates a huge canvas
for us to work in and added. Next we have the foliage. So the foliage and allows us
to paint grass and land and pebbles and rocks and all of these various things without
adding them individually. Once you create a landscape. And these go hand in
hand, by the way, once you create a huge landscape and you have mountains on
all of that good stuff. You want to add, for
example, rocks to it. You don't want to add every single rock individually
and then change it around. You can simply use
foliage to just have a randomized positioning
of all of these rocks. Next we have the mesh paint, which allows us to paint and add textures to Static Mesh actors. And then we have the
fracture editing. This allows us to create the structural objects
in our environment. And finally, we have
the brush paint, which allows us
to paint brushes. We'll talk about the brushes
in just a bit later on. Delve deeper into them. But for now, let's start off by removing everything that
we have and the subtle, and going back to
the Select mode, first we go back
to the Select mode and then we are going to delete everything except the
floor inside of the arena. Then we are going to
select everything inside of the walkway and
we're going to delete it. And we're going to delete this
weird the cube mash actor. There we go. Now we have this
platform all empty for us. I'm going to select it. The details I'm going
to scroll down. And then I'm going to set
the scale to be one by one. This will make our
canvas a bit bigger. I'm also going to delete
this, whatever and wherever. Then I'm going to move, move my character just a
little bit to the back. Now when we start the
game, there we go. We have this big, huge empty canvas, all for us. Excellent. Let's take a deeper dive into the Select mode because
it will be our main focus. First of all, we're
going to create and add some place actors. So if you look up here, you can see that we have
this Create button. Once we click it,
we are allowed to add and place actors
in our world. But before I start
adding these actors, I just wanted to maybe just alleviate the fear
of what I'm saying. By this time you are
probably thinking, what is an actor, what is an asset? What is he talking about? First of all, an actor. An actor is any object that
can be placed into a level. So if this floor is an actor and this player
start as an actor. This third person
characters and actor. All of these are actors, whatever can be placed into
the world is an actor. Next we have an acid. An acid is any piece of content within the Unreal
Engine project. All actors are assets. If we go back in
here, for example, if you remember, just show you what
the difference isn't just a little bit. And finally we have for bond. And the bond is the base
class of all actors that can be controlled by
a player or an a I. Whenever we have an actor that can be controlled by the player, it's called a pump. Back in here. We're going to click
on the Create. We can add any shape
or cube or whatever. But we can also click on
the place actors panel. Once they are clicked, we have this new
window in front of us. We're going to talk about
the various things. First of all, we
have the search. We use the search to
find any actor by name. So for example, I want the cube, I searched for the
cube. There we go. Under it we have the filters. You can see right here,
these tabs are used to quickly switch
between categories. So for example, I1 geometry, I want shaped I1 flights. I can find them
using the filters. And finally, we have the
Asset view right here. This allows us to view all the aspart assets
that correspond to the search or the filters
you've selected assets, what's the difference between
an asset and an active? While the point light
in here is an acid. But once it's dragged
into the world and now it becomes an act,
that's the difference. Everything that you
can add, for example, everything in the
Content Browser is always an asset until
you add it to the world, it becomes an actor. So let's talk about the
various filters that we have. First of all, we have
the recently placed. These are the history of up to 20 types of actors
you've placed in your level. These allow for quick access. So for example,
if I add the cube and then go back to the
recent, There we go. We have the cube
and the point-like. Next we have the basics such as the empty actor and
the empty character, the empty palm, the
players thoughts, all very basic things. We have the lights which allows us to add different
types of lights. You can place them
in your world. For example, we have also
the spotlight right here. We increase the intensity. You can see a white spot has been created
due to the light. We have the shapes, the sphere, the
cylinder, the column, the plane, everything
that you need, we have the cinematic. So these are the
cinematic cameras and related actors that you can use to simulate
real-world camera movement. These are mostly used for
cutscenes in your game. Next, we have the visual effects volumes that visually
create an effect. So part of your level
in some ways such as the fall of post-processing
and various reflection. So for example, we already have post-processing and
I'm going to go too deep into this right now. We will talk about
them as we go through. Next, we have the geometry. So if you remember, I talked
about painting brushes, and this is a brush, this geometry is a
bit different than the static mesh and that it can change shapes and sizes it
very quickly and easily. We'll talk about meshes
in the upcoming section. Next we have the volume. So the volumes are
3D areas of space and each has a certain effect
and a certain purpose. So for example, we have
a kill zone that kills. We have a blocking volume
and all your volume. We have these different
types and each one of them has a
certain purpose. We'll talk about
them as we go on. We'll use a lot of them. Next we have the all
classes in here, and these are all
the classes that we have despite and
without any filters. And also we have some classes, or some actors or some assets that are
here that are not in any specific filter because they are not categorized in any way. With all of that information, I'm going to issue a challenge. Your challenge is
going to be to add things to the boring
world that we have. First of all, at one asset from every place actor category, you don't need to
know how it works. You don't need to test it. Just try it out, see what each of
these can provide. Next, add a kill zone volume and make it a lot bigger
than the platform. So add a kill zone volume under our world so that when
the player jumps, jump from the
platform and see what happens once you touch the zone. And finally, remember to have fun and play around with this. And later on we'll
be delving deeper. I know I keep saying
that, saying that, but trust me, we will
be delving deeper. Pause the video right now, and go do the challenge. Okay, So how did you
get on with that? I'm going to go
into the volumes. I'm going to add
it goes on volume. And if you didn't know
how to make it bigger, I hope you tried
to figure it out. You can either scale it
up or if you scroll down, let me make this bigger. You can see that we have the brush settings and
I'm going to increase it the size and increase that
size and that direction. I mean, and I'll just move
it up to this position. Is it under the platform? Nope, it's not. So I'm going to
move it a bit down. There we go. Maybe make it a bit
bigger even than that, just in case we
don't jump over it. Let me see. Okay, Seems good. Now I'm going to play my game and I'm just going to
jump off the sides. And once I hit the
kill zone volume, I suddenly disappeared.
Why is that? Well, because it kills you. So I hope you enjoyed this video and I'll see
you in the next one.
8. Viewport Basics: Welcome back, My favorite
game developers. In this video, we
will be talking about the viewport basics. We'll learn what's the
difference between perspective and
orthographic will learn about the
various new modes and we'll also see how we can enhance our level
editing experience. So let's not waste any more
time and let's get started. Okay, So in this video
we are going to learn the basic Scott
basic concepts and features of the viewport
and the Unreal Engine. The viewports or your window into the worlds you
create an unreal. They can be navigated just
as you would in a game, or can be used for more
schematic designs. The sense of the
architectural blueprint. The unreal viewport contains a variety of tools
and visualizers to help you get exactly what
you need out of your data. First of all, the
viewport types. And by the way, the viewport is the square where
we see everything. The viewport types, there are two main view-port types
and the Unreal Editor, the perspective and
the orthographic. The perspective which
we are in right now is a 3D view window
of your world. The orthographic is
a front side top and 2D view of your world. You can change these
views by looking at, appear at the top left corner. Select perspective and
instead of perspective, click on the top. Once you're in the
top, you'll see that you have this kind of architecture looking
world that you have. And you can start moving
things around in here. And I just think
them from the top, which is very helpful whenever
you want to make sure that everything is perfectly
aligned in your world. We can select all of
these, for example, and just move them
to be exactly in the center of our universe. We can also look at
them from the left, for example, the recall, we can see our little
character from the left, from the bottom, from the back, and all of these good stuff. We can go back to
the perspective also, the viewport layout. By default you see a single
perspective review what, and also by default you can select to see all four of these. So you can see right here, I sorry, I did that too fast. At the top right, you
have this Foursquare's. Once you click them,
you can go through these views and you can see
that they are from the top, which is 0, from the bottom, from the top, from the
front and from the site. And you can exit out of
them by simply clicking on the maximize on one of the
windows that you need. Next we have the view moles. So in the Unreal
Editor viewport, we have a large number of
visualization wall to help you see the type of data being
processed in your scene, as well as diagnose
any error that might be coming or
happening or whatever. The more common view modes have their own hotkeys and we're going to just talk
about the main ones. So if you go at the
top-right, top-left, I mean, next to the perspective
you can see that we have this lift once you click on it and you can see that
we have other options. Sort the list shows the
final result of your scene once all the materials and light things
have been applied. So if I let's add
a light in here, by the way, I
removed everything. So I move up and I increase. There we go. So now we have a
light right here. So this is in the Lit mode. We can see everything. If I go to the unlit mo mode, this removes all
the lighting from the scene showing
your base color only. So if I go back to lift, you'll notice that the colors
and all of these things change because the light
that comes from the sun, some work there we
go, That's the sun. The light comes down and it hits this platform and also
reflects into the atmosphere. Believe it or not,
all of this is true. You'll see when we create
our own atmospheres and this lights up things
in the unlit view, the remorse, all of the lights. Next we have the wireframe, which is a very scary and
more than my opinion, this is the universe.
There we go. And this is similar to what
we saw in the 2D view. It shows all the polygons, edges, and the scene. So not, not much I
can add to them. Finally, we have the
detailed lighting, and this is useful
for isolating whether your base color affects the color of other
objects around. For example, when I add a
cube until the swirled, the cube is white and it
reflects actually on the ground. Let me show you in
the lift that regard, this is white and even
though it doesn't show, if you zoom in, you can see this faint, faint little shadow right here. I don't know if it's not
noticeable on the screen. If we go to the
detailed lighting, this one is helpful for
checking these things. It's not actually
the reflection. This case, it doesn't
really matter because it's not
changing the color. And if, for example this Q
was bright red or something, it will change the color
of the platform under it. We'll see what that
looks like when we create our cyberspace again. Next, let's go back to the left. Next we have the game of view. If I click on the G key. Who can see that all
the various widgets that we were using disappear. And this supposedly
looks the way our game is going to
look once we play it. So when we hit the Plachy, you can see we no longer see light or anything of
that widget type, or we don't see any
way of changing the position of the cubes
or all of that goes out. And this is what the G key does. It removes all of
these various widgets. Next we have the immersive mode. So it took me a bit of
time for some reason to find that even though that was the first
place I looked them. So we can go into
immersive mode. Well, how cool is that? This allows you
maximize and have the, have your viewport
to the full extent. That way you have. This is literally what I read on the documentations
of the unreal. This gives you a truly
immersive editing experience. So if you're ever
editing a level and you don't want to
see anything around you. You're already placed
all of your assets. You can go into
immersive mode and start playing around and have a fully immersive
editing experience with all of that information. I'm going to issue
you a challenge. Your challenge is
going to be to see things from a
different perspective. Try all the other options that
we have in the view mode. Yours, the unreal
recommendation and the helper windows to better understand what each
option represents. Unit unreal documentation
you can go and just check. And the unrealistic
meditation also use the orthographic
perspective to move objects around and
see how that feels. And finally play around and get comfortable with the
various controls. And by switching
around using the g, the game mode, using the GI button and
the immersive mode. So pause the video right now
and go do the challenge. Okay, welcome back. So I wanted to show you what assignment by Unity's
documentation. So let's go into Google or
every hour all the time. So we write in here
and lift on redox. And we get the options for the shading models
and the view modes. As you can see, this
is what we need. It says the oxygen thought
Unreal Engine.com. So once we click it, we go into the view moles
and you can see that we have a detailed description of the lip and lift
wireframe details, lighting, lighting
only, live complexity, shader complexity, stationary
light governor or whatever. So you can go as deep
as you want into these. I just gave you a quick overview of what all of these Thus do. Before I leave, I also
wanted to show you what I mean by the helper window. So if you click on the unlit and you hover over the wireframe, you can see that you have render the scene in
brush wireframe. If you hold down Control Alt, you open up this bit of
a display that gives you a bit more the negation
of what this does. And you can open
documentation from here. Then we go, this is
the hopper window. I hope you enjoyed this
video and I'll see you in the next one where we will
be talking about navigation. See you there.
9. Viewport Controls Navigation Controls: Welcome back, My favorite
game developers. In this video, we'll
be learning how to move around our
world much better. I know to this point we've
been doing a couple of things, but I haven't taught
you how to move around and I feel
guilty about it, but I think it's pretty
intuitive for anyone who's ever done anything on a
computer or use any program. So let's not waste any more
time and let's get started. In this video, we are
going to learn about the various control schemes
for the editors viewport. There are various control to enable the navigation
of the scene, to select, manipulate actors and change and display
options and all of them. Currently. If you've been
following the videos, I might not have thought you
how we are moving around, but I think you probably
figured that out by using the mouse button and moving
around with the WASD keys. But now let's delve deeper and understand better how
everything is working. Before we start,
I'm going to select this box in here and
simply delete it. We also had, I believe, some kind of postprocessing. So delete everything. The screen is freer. So before we start, I wanted to talk about a
couple of key abbreviation. So first of all,
we have the lnb, which is left mouse
button, the RnB, which is right mouse
button, the m, m, which is middle mouse button, and the fovea, which
is field of view. Let's go back into our world and let's start
working from here. First of all, we can use the standard way of
moving through the world. So how does that look? First of all, remove
your hand from keyboard and we will
simply be using the mouse. So hold down the
left mouse button and start dragging it around. You can see that you
can look around and if you drag forward
and backwards, you can move the
camera forwards and backwards and rotate
left and right. Then we have the holding down right mouse
button and dragging. This allows us to rotate the viewport camera
so you can see we are rotating while when we will when we were holding
down the left mouse button, we could not it around. It's dependent on
the angle that we set using the right
mouse button. And then finally we
have both holding down both the left
mouse button and row, right mouse button and
then moving them around. This moves us up and down. Now, this is in the
perspective world. If we go into, let's say, to this orthographic world, if you hold down the
left mouse button, you'll notice that we create
a marquee selection box, which allows us to select multiple objects
at the same time. If we hold down the right
mouse button and drag around, we select the world
and drag it around. And finally, if we hold
down both buttons or the left mouse button and the right mouse button
and drag them around. Then we can zoom
in and zoom out. So back to perspective. The last thing I wanted to
talk about is the F key. So for example, let's say we are somewhere very far away in here. And you'll notice while we are speeding through our world, if you use the mouse wheel, you can actually
slow down and speed up the movement of your
camera and the viewport. So let's talk about the F key. So let's say I'm
somewhere here and I select this cube and I
want to go back to it. I can simply press the F key. Now, I am focused on the cube. I didn't only zoom in, actually focused if I look away and hit the F
key, There you go. You can see that
we are focused on, and this will come into
play in just a bit. After the standard movements
using only the mouse. We can also have
the WASD controls, which feels more natural
to those who have played video games or
shooting games in particular. Very basic. If you hold down the right mouse button,
everything here is, while holding down the
right mouse button, you click w, you go
forward as backwards. A, the left. To the right. You can move the camera up. Q. You can move the camera down. And if you had the Z key, you'll notice that we increase the field of
view and zoom out. Or notice we didn't
simply zoom out. We are creating a
different app for V. And once we release the
right mouse button, we go back to normal. And we can also do this the
other way using the C key. Notice this is not
a regular Zoom. This is a F or V change
field of view change, which is very
different, so designed. And the C key, there we go. So WAS D, E, and the Z and the C. Finally, we have
the Maya style ban, which is Maya as a wave for designers in programs such
as Autodesk and AutoCad, where they have a
lot of 3D modeling. This is very helpful. For example, if we
select anything, we don't need to
select anything. Simply hold down the
Alt key and stop and using the leftmost button,
start dragging around. You'll notice that
nothing happens. But if we hit the cube, hit the F key, hit the ALT, and start moving around using
the left mouse button. You'll notice that we can rotate around a specific object. And this is very helpful if you are trying to model an object. For example, the third
person hit the F key. Now hold down Alt and hold down alt and then start panning
around it. And there we go. We can see that we can model, at least see this object from any side that we
want from any angle. We can also do this using
the right mouse button. So hold down Alt,
right mouse button. And you can see that we can zoom out and zoom in. So there we go. We can use these in
order to properly modeled our 3D models. Finally, we also
have the Alt and holding down the
middle mouse button and then moving around. And this strikes the
camera left, up, right, down in the direction
of the mouse movement. So there we go.
These are basically all the movements that we
can have in the viewport. Now that you have an
in-depth look into it, I'm going to issue
you a challenge. And that challenge is to
just simply fly around. Move around our world
using only your mouse. So use the left mouse button, right mouse button,
by holding both of them down plus dragging around. Also use the keyboard
with the mouse to move. So WA as the Q, E, and C, we're using while holding down the right mouse button
and obviously dragging. And use the F key to
focus on objects and use the Mayan key with an
alt plus the right, left and middle mouse
buttons plus dragging. And also I want you to go not only into the
perspective world, also go to the 2D world where you can also
use all of these. You can also use the
FG and the 2D world, but obviously not the Maya. I don't think so
at least anyway, this is for you to test out, go ahead and fly around, make sure that you are
comfortable with all of these navigations because as we move on and move
through our course, they will be much needed. The video right now and
go to the challenge. I'll see you in the next one.
10. View Controls Selection Controls: Welcome back, my fellow
game developers. In this video, we make
our world much more incredible because we'll be learning the selection controls, which will allow us to build a very weird and scary world. Look at that. How cool is that? Now, before we use to fill that, this is a very bland level. Now we have this crazy world, so let's not waste any more
time and let us get stopped. All k's. So you can select actors in the viewport
individually by simply clicking on one of them or in groups using a selection
in to the viewport. What am I talking about? Let's get started. First of all, the
simple selection. That's pretty obvious. We use select one. If you have a volume,
select the edge. There you go. You
easily selected. But what if you want to
select multiple objects? I've probably done
this without telling you what I did because I'm like that you select one of the girls on hold down control
and select the floor. Keep holding down the control. You'll select the cube. And then if you remove from the control, hold it back down. There we go. You can see we select again the
third-person character, so we can select
multiple objects. But what we also can do if we go into the 2D world or
before we do that, let me just add a
couple of objects here. So I'm going to add
maybe a cube down. We'll just put it a
bit to the sides. Then another empty sphere
Somewhere around there. Okay, that's too high. Go down like that, like that. Okay, back in the 2D
orthographic top view. There we go. We can see that we have
the cube right here. We have a cube here, and we have this little sphere right here. What we can do in the selection, we can actually drag around
and select multiple objects. So you can see that we've
selected the light, the cube, the network player starts
on an old and all of that except for this little
sphere that is right here, because during our
selection it did not fit. What can we do in that case, while we can select
all of these objects, then we can hold down shift and select the sphere right here, which gives us access
to the sphere. What we also can do is hold down the Control and then select one
of these objects. And you can see that
we deselect them. And while we have all
of them selected, we can actually move
all of them around. I'm going to reset
using the Control Z. And we can also, for example, hold down shift and click on one of these and hold
down control, remove them. There we go. So with that knowledge
out of the way, let's go back to the
perspective and let's talk about the transform controls that we've been seeing so far. You've seen those
little three ways, three colored arrows from
any object that we select. One, Let's delve
deeper into the, into those and understand
what all of them mean. We have three
Transform controls. We have the move,
we have the rotate, and we have the scale. And you can see the W, E, R, or the hotkeys and
order that allow us to access those various options. Now let's talk about
the three colors. Why do we have three colors? While because first of all, we have the x-axis, the y-axis, and the z-axis, and
each of them have a color and the narrowed to
indicate how we are moving. So let's go back into unreal and look at how
all of these works. First of all, I'm selected
this cube right here. If I press the w,
everything stays the same. If a price, the E
key, there we go. You can see I go into
the rotate mode. And if I press the
R key, there we go. You can see that I go into the scaling mode where I
can scale these objects. Now, you can also change between those
if you click up here, but we'll talk about
more on this when we go to the toolbar
section of the viewport. This controls in
late two, moving, rotating and scaling
the actors and the viewport using
the transform tools. First of all, we
have this moving. If we hold down the left
mouse button, there we go. We can move in the x direction, y direction, and z direction. If we're in the
rotating in lotus, we can rotate around the y, we can rotate around the x-axis and we can
rotate around the z-axis. And finally, when we're scaling, it's the same exact thing. Simply hold down the left
mouse key and you can go ahead and drag however things or however you want those
things to be dragged around. Now there is one more thing
that we can talk about, which is this little
bit right here. When we are rotating, you'll notice that
we're rotating around the center of the object. But what if I want to rotate around this
point in the world? Well, if you go back
to the Transform, Select and translate,
you can hold down the middle mouse
button and then you can move around your pivot. So now if I set the pivot
up here, for example. The pivot, drag it
into its place. This is very hard, but I'll show you this later on, a way that we can actually
drag this properly. So there we go. Now the perfect is in here. So now if I try to wrote it, you'll notice that
we rotate around that pivot and we also
scale around that pivot. You'll notice one
side is getting bigger than the
other because we are not scaling from the middle and all the movement
usually stays the same, but obviously it also
changes from here. Once you want to
reset the pivot, simply unclick on the object, click again and it will be in
the middle. The last thing. And then one of my
favorite is the way we can duplicate our
actors in the world. So if we select one axis, hold down Alt and start
moving it around. You can see that we can
duplicate this object and we can duplicate that again
and duplicate it again. And how cool is that? Not only does it work
in the movement, it also works in the rotating, so hold down the Alt
key and drag around. There we go. You can see that we
create a very nice shape very easily by simply duplicating our
objects that regard. So we've created some
kind of weird logo here. Let's delete one of these sides. Okay, great. Now the last thing I wanted to talk about is the vertices. So I'm going to go ahead
and add two shapes in here. I'm going to add this sphere, move it up, move it
sideways 90 degrees. And let's go ahead and
duplicate this sphere. There we go. Now we
have these two spheres. Now let's say we want
to snap them and place this right here
is working properly. But let's say we want
to know not like that, maybe 50. So there we go. We can see that we want
to snap them in place, but they are not properly,
properly snapping. So what we can do is we
can hold down the V key. There we go. And you can see
that we have all of these little blue dots, and I'm not sure if they
are properly displayed. Let me move this up a bit. Maybe this will get better. Select one of them,
hold down the V key. And you can see
that we have all of these selections which
are very helpful. You can see that we
can snap into one of these vertices right here. Now, this is also helpful if you want to move
around your pivot. So if you move your
pivot, for example, to move your pivot right
here, there we go. You can see it here. And then when we hold down
the V key, there we go. We can snap at much, much better, which
is very, very cool. Addition to our movement, will not be using this too much, but I just wanted
you to know just in case you come to it somehow. Now, the last thing
we need to talk about is the grid
snapping solve. You've noticed that I changed this grid snap right
here while we can change it to one
and the movement will be much more subtle. So you can see, there we go. We can simply move at one, or we can move it 500. So it will snap, boom 500 meters at a
time or centimeters. We can set it down, which
is the regular one, or we can simply
just the same way. So now we can simply drag it
around and we'll talk about the other two that
we have in here later on and to world toolbar. But if you are curious, this is for the rotating snapping and this is
for the scale snapping. So with that out of the way, now that we know how to move and rotate and
scale our objects, it's time for a bit
of a challenge. Your challenge is going to
be to create a real world. Use the tools you've
learned to rotate, scale, and change places of the
actors in your world. Use different sizes
and rotations. Experiment with
cylinders, spheres and cubes and anything
else that you find, and that's all that
you need to do. Solve. Pause the
video right now, go create the level and I'll
show you my level once. I'm done. Hey, welcome back. So I hope you enjoyed this
as much as i now before we, before I showcase
my level to you. First of all, there is one
thing that I forgot to mention and that is the
movement on both axes. You'll notice that we can
move like this or like this, but we can also select
in-between them and move them on
a specific blame. You can see that I
can select two of these and I can
move in this plane. Or for example, by looking
at from this way I can move this plane
and the reversal. This is the thing that
I forgot to mention, not a big deal, but I think you should know how that works. I hope you enjoyed
this video and let me showcase what
level looks like. So hit Play. There we go. You can see that I've created
all of these objects. And personally I think
this looks really, really nice because it
feels as if you are in a very huge rural and you're just a small guy on a platform. But before that, our world was very dull and very like
there was nothing. But now look at
all these objects. You feel that there is
a world to explore. And that is basically what game development and
game design comes to. It's all about
creating the illusion of a huge world around you. I've probably could have added a bit more things later on, we will be adding
different colors to all of these materials to not
make them look that land. So I hope you enjoyed
this video and I'll see you in the next one.
11. Viewport Controls Toolbar: Welcome back, my fellow
game developers. In this video, as you can see, we've built a hot, which is a very cool hot and we've surrounded
by something that I will not tell you until you do it as your own
on the challenge. So when we play the game, you'll notice that we have
or how much we also have this FBS that is on
the top right corner. So in this video
we will learn how every thing in here
on the toolbar works. So let's not waste any more
time and let's get started. Okay, so now let's talk about the toolbar that we have
right here on the viewport. Some of these
options you already know what they do, some don't. So let's delve into them. First of all, we have this
viewport options right here, which is accessed by clicking
these three little dots. And you can see that we
have a ton of options. So let's just talk
about the main things. First of all, we have
the real-time which toggles the real-time
rendering of the viewport, which allows us to make
sure that the shadows, for example, change
all the time with the movement of the various
actors in our world. Next, we have the short FPS, which shows the frames per second that we're working with. A few are familiar with
any type of gaining, you know, how all this works. Next we have the shore stats, which also shows
different kinds of stats. We, let's turn on the show FPS. There we go. You can see it
right here, shows stats, display statistics in the
viewport that the band on our lot of different
things which are right here. For now, there's nothing in our level to actually
show starts about, so we're just going to go
ahead and turn them off. Next we have the very stats
that we can turn on and off. Next we have the
four view plane. So let me show you
what that does. Let's say, for example, we are standing here at 0, it will be infinite. But as I increase this slowly, you can see that objects
are starting to appear. So what's happening in
here is for the sake of saving a bit of
memory when you're working in huge environments, this is good to use to, in order to not see the
things that are too far at, at a very far distance. So let's say I'm
here, for example. I'm editing Garan all
this cube for example. And I don't care what the cone or the cube on the other
side of the map is. I can simply take this now, work with the skew and
then put this back up. If I want to remember
that at 0, it's infinite. Next we have cinematic controls. This ability to prove,
preview our level. If you have any kind
of camera or cinema, the world, this allows
us for camera shake. You already know
the game view and the immersive view mode. We have bookmarks.
So for example, we can bookmark camera
locations and rotations. And we can also do this for heart of other
actors and our world. We can place a
camera right here, which is very helpful if
you are creating some kind of maybe a cutscene
or something. We have a high
resolution screenshot which does what it says. And we can also
set the layout of our various worlds in here. Let's continue on. What else do we have? We have the view mode, which we already know, the perspective and
the two the views. Sorry, I meant this is the view mode and we can choose between perspective
and orthographic. We have the view
modes right here. We have the flags, the show flags we've found
under the view port show menu. They are the means by which
you can show and hide many of the items that are
viewed in the viewport. Let's talk about a couple
of these anti-aliasing. If you've ever played the game, you probably knows,
know what that is. It's kind of like
helping the edges. So if I click on that, you'll notice that the
edges are a bit more square and a bit not as sharp
as we'd like them to be. This saves up by
a lot of memory. And we have the atmosphere. We can turn off the atmosphere. If I click that,
nothing really changes, but it's a very subtle
change in my mouth. Notice we have the BSB, which has the geometry
given this one and mine, we have the collision, so we can show collisions. There we go, and we
can also hide them. That's better. We have the details so because we can show
them the details, what details they are, materials that are
projected onto meshes. We might see more of
them when we talk about materials,
we have the fork. So if I, for example, turn off the fog, you can see at the distance
there is no more fog. Let's try this on yet. It's a very faint illusion
that we've added, but it's not that noticeable. So all of these things are in as noticeable if you
turn them on and off, but they do affect
what you can see and what you cannot
see in your level. Next, we have the four
options to select, select, move, rotate, and scale. We have the coordinate
system right next to it. So this determines if we
are moving in the world coordinates or in a
relative coordinate system. What do I mean by that? Currently, if I
move this object, for example, they will
go left to right. I move it in our world
and if I rotate it, I rotate it in a relative scale or
actually a world scale. But what if, for example, you can see that even
though I rotate it, the movement is still the same. If I change this, you can see that now I
can move this relative, not in the world coordinate, but in a relative
coordinate system. And this is also reflected right here on the transform
of that queue. You can see if I, for example, rotate this in this
direction and then set the coordinates
to be relative. Now I can move this cube
relative to its rotation. Next we have the
surface snapping. So if I turn on
surface snapping and I create a shape such as
the cube and I drag it. You can see that it
snaps to the surface. Now you might think, well
that's not that impressive, we already seen that, but this also does, does it can rotate
to the surface normal and we can also
create an offset. So I'm going to set an
offset of 100 and I'm going to create a shape
which will be a cylinder. So you can see that it's floating above the ground
because of the offset. And if I want to
drag it over this, you can see that
it is snapping and rotating based on the surface that we are trying
to add the sphere. So this is also very helpful. Let me turn this off. Next we have the grid snapping. We've talked about this, we can set it to whatever
grid that we want. So for example, for 100
the snaps every 100, little a unreal units. Let's call them. Next, we have the
snapping for rotation. So for example, right now, you'll notice that we snap at
a ten degrees or 20304050. We can change that to be,
I don't know, maybe 60. So there we go. Now we snap at a 60 degree rate how holes that we can also
turn off the snapping and have this smooth rotation of our cubes and objects
and actors and the world. We also can do this
to the scaling. So for example, I can set this
scaling to be ten or not. That's going to be overkill. The one. There we go. We snap one by one as we move. Great. So let me take this back down because we don't
want to have that high. Next we have the camera speed, so we can speed up the movement
using our mouse wheel, but we have an extra option
to move this up to eight. There we go. You can
see how fast that is. And we have the cameras
speed scalar, which will, as you can see, makes
movement extremely fast. And this is the atmospheric
that I was talking about. And you probably
didn't believe me, but there we go, you
can see the effects. The sky sphere
blueprint that we've created and this is the
world and that's the Sun. Let's zoom back in. That
good habit crazier, right? There we go. Let's
put it to four. And finally we have
this square right here, which allows us to
select from one of the orthographic
perspectives, or orthographic views, or the perspective
that we have in here. So that's everything that
we have in the toolbar. Finally, let's issue a small
challenge to build a hut. Built a simple health
using all of the scaling, rotation and grid
snapping you need. Put inside your crazy level, put it inside your crazy level. Use only static meshes to build. It's all the cubes and
spheres and whatever you want surrounded with geometry, and then hide the geometry using the flags so we
can see the heart. So it's pretty much
something like this. No need to make it
too complicated, just surrounded and try
to hide the geometry, just like I hinted
that previously. So pause the video
right now and go do the challenge case. So let's first of all turn of the show stats
because I can see them. This is my hut, but this helped hides a very dark secret because
when we play the game, you'll notice that it's
surrounded by these massive, massive geometry shapes that
not allow us to come in. But when we are editing we
can see them. Why is that? Well, because if we
click on the Show, which allows us to
change the flags, we can turn on and off
the showing of our Vsb. Keep in mind, first of all, this does not delete the items. This always keep them, keeps them in our world. You can verify this by simply clicking on it, looking
into worldview. And if we turn on, turn off BSP, we can still see it in
the World Outliner, and we can still click
on it and move it. So the flags only hide within the viewport and only high
that they do not destroy it. So why do I keep
seeing the shore? I don't know why
for some reason. Anyways, I hope you
enjoyed this video. And before we leave,
let's go ahead and delete these geometries
because they take up a lot of space in the memory process
and you'll know why later on as we
learn from them. So I hope you
enjoyed this video. I hope you are doing
the challenges every single time
as much as you can, even if they're hard, even if they're easy. So it's always
good to go out and do things yourself to practice. See you in the next video.
12. Content Browser: Welcome back, My favorite
game developers. In this video, we will be
learning everything there is to know about the
content browser. So there will be
no more ambiguity. You will know what each and every single button does
and why it's there. Not only that, you also
have the chance to use your creativity and
adding these materials, making the weird shapes
and you're weird world, beard world, much
more pronounced. So let's not waste any more
time and let's get started. Okay, so now it's time to talk
about the content browser. The content browser, which
you can see right here is the primary area of the Unreal editor for
creating and porting, organizing, viewing,
modifying contents and the assets within
your Unreal Editor. It's also useful for operations on assets
such as renaming. You can rename any
acid you want, moving, copying and viewing
the reference. My default, it's always down
here on the bottom left. And it always hide itself
whenever you are not looking. But you can also dock it. So you can dock it in the layout if you
don't like it there, just simply undock
it by clicking on the right here,
the little x bottom. So let's talk about this view. I personally, I like for it to go away and high because
we sell them, use it. So I'm just going to keep it like this undocked if you want, you can block it, be my guest. Let's talk about the
various or the UI, the user interface
that we see in here. First of all, we have
the navigation bar. We have the source view, we have the collections panel, which we see right here. We have the asset
management area, which is right here
where you can see the search bar and this
weird Antenna thing. Then we have the view window. So let's talk about each
of these one-by-one. First of all, we have
the navigation bar which allows us to add, first of all, the ad right here, which allows us to create a
new content for our world, like the blueprints, which we'll be learning in
the upcoming lessons. Next we have the import
which allows us to add files from our computer
to the unreal world. We can also
alternatively drag items into here or assets into
this asset view right here. Or we can also add them
manually from outside Bye immediately adding them
from directory to directory. We will be seeing that later on. Next we have the same
wall which saves everything in the window
that has changed. We have the history
back and forward, which this kind
of functions like the web Bryce web browser when you're scrolling through
page after page, these button allows you to
navigate to the recent files. So for example, let's
say I'm on content. And then I go to meshes here. And then if I click back, I go back to content or if I
go into character texture, wherever I can then go back
one-by-one as I went through. Next, we have the breadcrumb, which is the breadcrumb. Let me show you when I open
several ones right here, this section shows you
the current file path, which allows you to quickly navigate to the parent folder. So you can see that I
entered content mannequin, character texture
item can go back to mannequin or I can open from mannequin here
with this little arrow, the animation and the character. Next, let's talk about the source panel that we
have right here on the left. This source panel is
located to the left. Obviously it contains a list of all the folders and collections. We'll talk about that
within your game project. So what we have in here is
we have the search bar. Obviously, this field allows you to narrow down the list of available folders by entering
some kind of criteria. And then we have the
acid tree that we see, which is a hierarchical
list showing all the folders currently
in your game project. And each folder is
expandable and collapsible with a small triangle or wherever you want to
call it to the left of it, which allows you to see
everything in a hierarchy. Next we have the assets view. You can see right here. So
when I open up the textures, these are the
assets that I have. And this is the primary region
of the content browser UI. This region provides
a grid or list of all the available in
assets within a folder. After all the filters and
searches have been applied, we will see what I mean by that later on and I'll
tell you also what I mean by having either
a grid or a list. First of all, we have
the viewing area. This shows array of assets, including the selected folder, and it will be adjusted
based on the filters. We have also the asset account. You can see it right here. It tells us that we have
six items, which we do. And if we select a
couple of these items, for example, you will see
that we have three selected. And finally, we have
the setting up here. Even though this
technically belongs to the navigation bar
I wanted to talk about here because it's more
related to the asset view. You can see right here, we can decide what content we can see, what content we can't see and which way we
see the content. So for example, right
now all the assets and RNA tile view or I can
select a list of view. So now I have this
type of viewing or I can select a
column in a few here, a little bit of the
background. That's my fans. Fans as an fans that like me, friends of my laptop because I think all of these stuff in here takes its toll on the PC. Let's come back
into the continent. The browser and
setback is tutorials. Now we have the asymptote
management area, which is here. This provides a wide range of
functionalities for assets, including the searching
and filtering and saving. Also, you can see this
little Save right here. So first of all, let's talk about
the filter bottom. This opens up the filter
section when I click on it, where you can
choose what filters you would like to
apply to our assets. For example, let's say I'm
in the content right here. And all that I need to
see are the materials. I click on Materials. I have this little
bar added here, and then only the materials are shown inside of the content. If I go to geometry, you can see that I can only
see the cube material. But if I uncheck this one, you'll see that I
have multiple folders with multiple object
types inside of them. But once the material is filter
is applied, there you go. You can see, we can
only see the material, but we can also apply, for example, materials
and textures. So you can apply multiple
materials on top of each other. Next, we have the search bar. This field allows you to
narrow down the list of available assets by entering
some kind of criteria. And each character
that you enter will start immediately
searching. If, for example, if I search for something
that starts with a T, We have or not starts
with actually has it. Maybe I want a
table. There we go. We can see that we get the
material for the table, the actual table, the
texture for the table. And let's say I'm just
interested in the texture. I just add the filter and the combination of
them as applied here. And we have this little
Save right here, little Save Current Selection just in case there's something. Now let's talk about
the collections panel. You can see it right here
and it's currently empty. The collection panel provides
a quick access list of all the collections created
on your workstation. We can obviously expand and collapse with
the little triangle. We can add a list right
here so we can create a local collection and we can add items to that collection. So why do we need a collection? Anyways, let's, you might be thinking why not create
a folder right here? Well, the problem is, let's say we have a table. We'd like to have this table. We create a folder
and the content, the browser, hey, New Folder. Tables, okay, we enter into the tables and we add all of
our tables in this folder. But let's say we
have red tables and Green Tables and blue table
and all of that good stuff. What if we want to add
everything blue together? Do we also come to the
content right here and create another folder for
the blue stuff. Blue stuff. Just call it blue stuff. Now we also want to have a
table here and that is blue. And then put a table here. Sorry, a table inside
of the blue stuff. Well, you can't do that, but this starts to take more
memory because everything in here has a certain
size if disk size, and the more you add,
the more you have. But this is where the
collection can help us. For example, let's
create a collection of things in level one. Let's say I can go right here
and just search for table. Let's say we have a
table in level one. There we go. I add
to the collection. I also want to add the, let us say I don't know. Let's search for something
blue and the content. So I also want to add the slant. Now, I can see that
in the collection, I have this blue lamp or
whatever and a table. And keep in mind that whenever you add something
to a collection, it isn't copied and
pasted it only reference. So this is a reference to the actual table inside of
the component, the browser. I mean the content folder
that is right here. So this is the power of collections and allows us
for quick navigations, and it has references
to the object so they don't take up
any extra space. So I hope you enjoyed. I hope all of this information
wasn't too mind-boggling. Now it's time for a
bit of a challenge. Your challenge is to
make grids or something. So click on the Content
folder and the source of you, filter out all the
materials available. Add the materials
to your cube in the crazy world by
dragging them onto the objects and play around
and see what else you can find if you maybe want to create some kind of
collection things. So pause the video right now
and go do the challenge. Okay, welcome back. How did you get on with that? So I'm going to click on the
Content, click on material. And just like I told you, I'm simply going to start
dragging these onto our levels. So jagged is here, and now it's time to dock it because we were using
it. So there we go. We have everything. Let's add this q
material, this here. And let's add this
to the floor because our four seems very boring. Let me just expand this. Or what else do we have? Let's add some concrete. Add some grass at Mars
at some metal at, oh, this looks nice for before. I want the floor to
be completely white. Maybe a different kind of white. Anyways, we'll add
gold will add metal, copper will add, a rock, will add not V rock a rock. Let's add this one also. This one is one of my favorites. Let's see what else
do we have this one, this one, and we're starting
to run out of time. So I hope you enjoyed the video. I'm going to click on this and I'll see you in
the next one if you want to take your
time and add it to all the cubes and
all the shapes. So I'll see you in the next.
13. Details Panel: Welcome back, My favorite
game developers. In this video, we are
going to be learning about the details
panel above parent and child relationships and about simulating physics and how
objects move in the world. Nothing really strange happened except that we have
able to physics. So I like to in this video not only talk about
the details panel, also things around
the Details panel, things a bit maybe
niche and Unreal. So it's not always focused on a single thing in the world. Thank you so much
for watching so far. This is, I don't
know which number of videos you've been
watching, how many hours? It has been a thank you. I appreciate you. If you ever have the
time, leave me a review. It helps me out a lot. If you don't feel like I deserve a five-star review,
contact me beforehand, let me know what did you not like and I will go
through that with you. So let's not waste
any more time. And this is a long intro, right? And let us get stopped. So now it's time to talk
about Details panel. The detail panels contains
information, utilities, and functions specific to the current selection
and the viewport. It's containers, the
transform edit box. So if I select the Skew, you can see the transform
edit box right here, which is responsible
for moving, rotating, scaling, and displaying all
the editable properties. So you'll notice when I
changed the location, it changes when I
change the rotation, these value here changes
and obviously the scale. And we can change this
from the Details panel. You can hover over this and use the dragging of
the mouse button, or you can simply change the value immediately
right here. Now, let's delve a bit
deeper and see what else we have in here and start
immediately from the top. First of all, we have
the actor's name. You can set friendly names to the actors directly
in the editor. These names can
be used to access related actors or find
using some kind of search functionality is
there in the world outliner or later on as we are
creating blueprints. So if I double-click on
the cube that we go, I can call it the test cubed. Okay? Next we have the Add button, which allows you to add more
components to your actor, and we'll cover that
later on in the course. You can see, for example, we have the static mash
component inside of the cube. Next, we can add a blueprint. This allows you to create a
blueprint out of this act. And we've seen this in our
first game that we did. But for the sake of explanation, I just wanted to
make sure that we understand both of these things. Of course, as we move through the course in the
upcoming sections, we'll delve deeper into
each one of those. But for now, all that
you need to know that components are
special types of objects that actors
can attach to themselves as some
objects and blueprint. Our blueprints are
a visual scripting the Unreal Engine using a node-based interface to
create gameplay elements. So let's go back into our Unreal Engine next
to the blueprints, we have this lock. So when we click on the lock, if we select any other object, you'll notice that we are
always on the test tube. And this is very helpful for your editing and
you just want to move around and
you don't want to deselect this cube by mistake. So if I unlock it, we're still on there
until I click on another place and then we
don't have it anymore. Next we have the
search filter box, which allows you
to type a text to filter through in which
details you want. So for example, if I want
everything related to physics, I can type in physics. And if I want anything
related to static, there we go, I can
type in static. Next we have the property
matrix icon on here. This opens up a matrix
which allows you to view multiple property
values belonging to multiple actors at the
same time will not be talking too much
about it because it's able to advanced topic. And to be honest, I've rarely used it. I've never really found any meaningful
functionality to it. You can always get around it, but some people
prefer to use me. Honestly, I'm not
a huge fan of it. Next we have the
toggle favorites. So for example, we can set one of these elements
right here to be favorite. So let's say simulate physics. I can add to favorites. And now I can select
Toggle favorites, and now I can see the favorites. I can add multiple favorites. Let's unfavored that and remove
from favorite, this one. Next to it we have
the setting which is, which displays options
to expand, collapse, and otherwise filter
property categories. So for example, show
ALL advanced detail or collapse or expand all of
the options that we have. Next we have the properties
area which is here. Let me just make this bigger
and how the World Outliner for now and make this bigger on this side so we can see
everything properly. Displays the actors properties. They can be viewed or modified. And you'll notice each of these properties are set
in specific categories. So let's talk about, will not talk about every
single one of these because there are many of
them and some of them, some are specific to
certain other actors. So for example, the cube
has these properties, but if I select
the third person, you'll notice he
has animation and meshes and different
options in the physics. So different actors have
different properties. Now let's talk
about the favorite. Why would we need any favorite? Well, if there is, There's our properties
with an actor that you frequently change and you
want quick access to, you can use the favorite
properties in order to have them at the top and
then scroll between them. Next, you will
notice that we have this little arrow right here, which allows us to return
to the default value that the box or whatever actor
you selected goes back to. For example, if I change
this material to rock, to break, and I want to
go back to the default. I can simply reset this and we go back to the very default, which is not what we want. We'll set it like this. We can also, for example,
reset the rotation. There we go. Everything is 0
and we can reset the scale. And also recently position
controls that controls that to reset the
undoes, the reset. Also let's take
notice and talk about the transform here a
bit before we move on. So almost every single actor you will ever replace in your world will
have a transform. That's why it's
very important to understand what's
happening in here. First of all, we have the obvious location,
rotation, and scale, and we can log the scale so that way when we increase one, the other ones also increase depending on where
they're starting. Then we have the mobility, which is also very important. We have the static. Static means we are not allowed to move the
object in any way. Stationary is like a
predetermined movement. So the object can maybe move, but we know in which direction
it's going to be moving. And we have the movable, which means that this object will interact with the world. Now mainly why do we need to
specify one of these three? Because static
objects, for example, you can see that they
already have a shadow. And shadow rendering
is actually something pretty hard to do if you
are simulating light. So if you have something
that is stationary and Unreal Engine knows that
this will be stationary. It can just bade the lighting
before you start the game. And that way it will
save up a lot of memory when it comes
to stationary, it can cache that a shadow and know where
approximately it will be. While, when it's movable, this will be the slowest
rendering and it always casts a dynamic shadow, which means, meaning that
it's always changing and taking lots of memory
out of your system. So the final thing
I wanted to talk about is parent-child
relationship. You'll notice right here that we have this cube all
alone, all alone. I'm going to move it right here. I'm going to go ahead and
add another shape in here. I'll add a sphere
and to the swirled. And I'm going to
take the sphere, I'm going to drag it
over into the test cube. So now we have a child-parent
relationship where the test cube is the parent and the little sphere right
here is the child. Now, how does this help us? If I move now vest cube, you'll notice that the
child moves with it. If, for example,
rotate the parent, the child rotates with it. If I rotate in any direction, the child rotates with it. And if I scale, the child also scales with what we have
at basically takes up all the properties
that the parent has, which is very nice,
which allows us to create multiple things. For example, if we
have a planet and we want to have the skew of
the center of the planet. And for the little
sphere to be the moon, we can just anchor
them together. And if for some case our
planet moves around, this sphere will move around with one more info
I would like to say is just like we
have the relative and the global rotations in the
view port panel or Toolbar. You can also have
them right here. So you can see currently, if I reset the position a lot is that the sphere is in
a very weird position. If I take another sphere
and add it and put it exactly in the same location
that we have right here, or almost the same. You'll notice that
its coordinates are 295 minus, minus 34523. But the second sphere, which is a child
of the test cube, has very different coordinates. That's because it's relative. It's relative to the cube. If I reset the
position on all sides, you can see that it does not reset to the middle
of the world. It resets to the middle
of its parents transport. This is something in
mind when working with these various
parent-child relationships. You can also, for example, click on here and select world, and there you go,
you can see that the coordinates are
back to normal. So with all of that information, time for a bit of a challenge, your challenge is to
have a bit of a change. So look through the properties
you have at your disposal. Some are familiar. Find a property you
believe you can change and making a difference in the actors are clear round, just find something,
look, worry about it. You can always reset
it to the default. Select one of the actors and
make it simulate physics, or how does that
affect the mobility of the transport tested in
your game by playing it? And finally, create a parent-child
relationships and play around with the transform and get used to it to understand
better what's going on. So pause the video right now
and go to the challenge. Hey, welcome back. So I'm going to get this little sphere that
we created earlier. I'm going to put it in front of the player,
move it up a bit. I'm going to search for physics, and I'm going to click
on simulate physics. Now if I play the
game, There you go, you can see that the
ball felt from the sky and it also bounced and I
can now move it around. If we look back
in here and we'll notice that the
mobility of the sphere changed from static to movable because it
has to be movable. If physics can be applied to it, then it is movable. Now watch what happens. Similarly, physics is
on, mobility is movable. If I change it to static, you can see that the
physics simulation is no longer available. So I hope you
enjoyed this video. I hope you've tested out the parent-child relationship
and I'll see you next time.
14. World Outliner: Come back, my favorite
game developers. In this video, we are going to be learning about the World, Outliner, everything
inside of it, how everything works,
and why it is needed. So for example, remember when
we had all of these shapes, you might have noticed that
everything was very clumsy. We couldn't understand
what's happening. But now, for example, I can turn off all of the
shapes on my platform. And if I want, I
can also turn off all the weird world shapes and clean up my environment if
I ever wanted to do that, that out of the way, let's not waste any more
time and let's get started. Okay, so time for the maybe
last video of this section, it's time to talk about
the World Outliner. So let's make this a bit bigger, make the Details
panel a bit smaller, and let's look at
what we have in here. So the hierarchical tree view of all actors within
the current level are inside of this World. Outliner. It can be
used for selection, attachment, and a
lot more things. As you can see it
as a hierarchy. We have everything that is lightning based
under the lightning, everything I'm the arena base under the arena and
so on and so forth. And you can see also that
when we have a child parent, parent relationship, we also
have a hierarchy for that. So the World Outliner displays all the actors within the
scene in a hierarchy tree. And actors can be selected, modified directly from
the world outline. And what do I mean by that? I mean naturally a while. What is meant by that? Is that, well, for now there's
nothing in particular. But for example, let's say we have the third-person character. We can immediately go to its blueprint by
clicking right here. We get its opening editors and hopefully today they're
regards all weekend. Immediately start
editing this from here. Now, let's talk about the
various elements of the UI. First of all, we have the
search box which allows you to type a text to filter
actress display. For example, I want
all the cubes. I get all of my cubes. Next we have the list
headings right here. For example, we have the label displayed and
we can set them to be from in the search be based on the label
from top to bottom. We also have the
pipe right here, so we can right-click
and we can change this from the type to want
to know the ID name, the socket, the level,
the mobility, wherever. We can also change this view I. So for example, if you
click on this right here, we have this little
option that allows us to turn it off and then
turn it on back again. So we have the eye
viewing option. I moved on too quickly and I didn't talk about
the Create folder. For example, just like we have a folder up here for
the render effects, the arena and whatever. We can also select
multiple objects, then set a folder to them. So now they are neat and a folder and we can
close them down. This is something that we
are going to do in a couple of seconds or minutes to fit all of these various cubes inside of some kind of folder. Next we have the actor list, which is very obvious
list of all the actors unless they have been filtered out using this
setting right here. So we can, for example, if we wanted to see
only the selected, so we only see the cone five, we want to hide
temporarily actors, we want HIV actor components
and so on and so forth. And that's basically,
that's all there is to the World Outliner
and not much salt. What I'm going to do is I'm
going to click on this cube. Let's see. I think that everything in
here shouldn't be selected. So what we can do is
we can actually change the perspective to
talk. Zoom out. Now we can see all the big cube. So I'm going to
select these cubes. Hold down, Shift
select these cubes. Well, I'm just calling
everything cubes shapes. If you want to call them. There we go. So all
of these shapes, I've selected all
of them almost. I think if we zoom
in, we have okay, this is the, this is something that we
would like to select, hold down control
and select that also without the blue
sphere on the cube, what else do we have? What are these cubes or I
think there are cubes or no, no, that's not the
cube that we want. I'm sorry for taking so long. Okay, so now that we have
all of the cubes selected, I'm going to go ahead and
add them to a filter. Let's call them the weird world. Shapes hit Enter. And let's look from
the left perspective, make sure that to be okay. I think we got all of them. Yeah, I'm pretty confident
that we have all of them. So if I go back to the
perspective, there we go, we can see that we've
selected all of them and now we can turn all of them off. How cool is that if
we ever need to, for example,
duplicate this level. Now we have a much
neater, not very neat. For example, we can also
set all of these cubes right here to be
part of the level. So for example, these
are the shapes. Let's add shapes on platform. Shapes on the platform. So now I can turn
all of these off. And obviously I haven't selected
everything that I could. Just add all of these. Okay, so let's see
what the problem is. What else do we have? These two cubes?
Let's add them to the shapes and the platform. And what else do we have if I turn off the shapes
on the platform? So these two cubes add them to the shapes on the
platform, and there we go. So now we have all the
shapes and the platform in one single place. There we go. Turn on, turn off, and now we have a much better and
well-organized World Outliner. For the last thing
that we need to do is we need to issue you
a bit of a challenge. And your challenge is to
go to Google and type in World Outliner Unreal Engine. Once you do, you'll get the documentation for
the Unreal Engine four. But don't worry,
it's pretty much the same except for a few option, which is the setting icon. Now scroll down and
see how you can use the plus and minus to find
actors and the world. This is one of the
challenges where you will be doing it yourself. So I'll just guide you through the process and then I'll let you figure it
out on your own. And if we go in
here, for example, we start off by writing World Outliner unreal
documentation. Now you are beginning
to understand how you can find
things yourself. You are becoming a
problem solving mastered. You find the World Outliner, you open it up in a new tab. You can also look through the World Outliner
UI if you'd like. Here. See we have a ton of information about the
Unreal Engine four. Unfortunately, there
are no documentation for the Unreal Engine five. That's why this course
is so important. Five-stars, please raise
the World Outliner. And if you scroll down, you'll notice that you have
something that you can do. Searching through the world. You can either use the
regular sky wording or you can use the plus and
minus for various things. So this is the part
where I leave you to it. If you want, you can
search through those. I am CVS never use them, but I would love for you to test things out and do
something on yourself. There's no consequences, do not finding out how this works. So I think it's pretty safe
to let you go on your own. Little grasshoppers. Go ahead and do
your own research. Try new things I
love about yourself. And thank you so much
for watching so far. If you haven't
left a review yet, this would be the perfect time. So thanks so much for watching. See you on the next one.
15. Section 3 - Unreal Architecture Actors - Static Mesh Actors: Welcome back, My favorite
game developers. In this video, we
are going to have a guide to placing
and working with static mesh actors for creating worlds and geometry
and our environment. And even though we've
already worked with that, we are going to delve a bit
deeper and understand how did we add a chair made of grass
in the middle of our level. So let's not waste any more
time and let's get started. Okay, so it's time to talk
about Static Mesh actors. Even though we've
been using them, we've been applying
them into our world. Now it's actually time
to develop deeper and really understand what
we're working with. Before we start, we need
to understand that there are two main types of meshes. We have static meshes and
we have skeletal measures. So these are the
differences between them. One uses is used for
rendering geometry, the other is for
complex animation. The static mesh
has only one part, skeletal has multiple parts. The static measures
does not have any movable parts on it
while a skeletal mesh does. And finally, these are the
two icons that we see. And you'll notice
these icons when you create a new asset in the content browser or
when you add one and you look at the World Outliner. We in this course are going
to be focusing more on the Static Mesh actors because
they are more simpler, simpler, and easier
to understand. Skeletal Mesh actors
are a bit more complex. Let's begin. Back in the Unreal Engine. Static meshes are one of the most fundamental types of renderable geometry
in the Unreal Engine. In order to use these
niches to public or world, the static mesh actor is used. So there's a difference between a static mesh and
Static Mesh actor. Static meshes once dragged into a level from
the Content Browser, are automatically converted
into static mesh actors. So if I open up in here, I got to the content. And if I set the filter
to have static measures, you'll notice that all of these right here are static meshes. If you hover over them, you can see their type. The top right of this
little box that opens up. But once it's dragged
into the level, now when you look at it, you'll see that the type
is a static mesh actor. There is a difference
between them. Keep in mind that
though these are called Static Mesh actors, this simply refers to the mesh. So this is a static mesh, but it doesn't have to be, it can be movable, just like we saw earlier. It can be an elevator
which makes it movable, or it can be completely
dynamic whenever it is. Whenever it has physics. So usually we have these regular basic
static measures such as cubes,
spheres and cones, and maybe a stair that's still
considered a very simple, basic static Match, but we also have complex meshes
such as this table. This is also a
static mesh actor, but it's basically like a cube. It has a variety of
shapes inside of it. Not only that, it also takes
multiple types of materials. So you'll notice whenever we
add a material to the score, it becomes copper all over. We can see right here. But once this stable, as it has a material, you'll notice it has
several materials, you, it has many elements or a
combination of elements on it. This is also something
to keep in mind. And finally, we have
to understand that Static Mesh actors also have a static mesh component on them, which gives them the specific
shapes that they have. It's not about the
Static Mesh actor being alone on a
cube and that's it, that's forever we can change
what shape that static mesh has by changing the element that it
holds right here. And actually you're
going to see that for yourself by turning
that cube into a chair. And honestly, I don't
care if it's a chair. You can turn into
whatever you want. I am probably going to
turn that into a table. So select one of
the cubes that you have rotated and
scaled in your game. Even not a cube, you can select anything, any static mash. Those are just words I use whenever I create a
new cube if you want. Now changed the Static Mesh
property from Cuba to chair. And notice how the
chair or table or wherever takes the same
transform properties. So pause the video right
now and go do the Chaldean. Okay, Welcome back. So let's see what shall we use? I'm going to select this huge cone in
here on Static Mesh. I'm going to select a table. Table. Once I click on the table, you can see that this huge cone has
suddenly becoming table. Not only that, it has become
a huge freaking table, and it's also made of grass because the comb
was made of grass. So you'll see that it takes
on all of the properties. The shape, the, I mean, sorry, the location, the
rotation, and the scale. And it also takes after the element that
was on that column. And now that they will actually have a
table made of grass. So that's something you did
not expect to do today. So with that information, I hope you enjoyed, but before
I leave you, I also like, although we already
talked about this, like when you add the
physics through this mall, when we play the game, you can see that
that ball falls. Not only that, we can also interact with it
and push it around. And once it has physics on it, we can also change how this Static Mesh might behave
when we interact with it. So if you go down
until the physics, you'll notice that we can turn off the gravity if we want. So it will simulate
physics once we botch it. Let me show you how
that would look like. So I'm going to put
this down right here. And let's turn off the
enabled gravity hit Play. Now I'm going to walk towards this ball and you see
that once I push it, it just doesn't have
any gravity and it starts floating away. How cool is that? So there are a lot of things
to play around here with. So for example, we can
increase the weight, whereas the weight, so we can increase the linear damping. So how much it slows down
the angular damping, how much it stops spinning
would be very good. If we have, for example, a cone or a cylinder, we can change the mass. We can take this mass
and instead of 100, let's make it a thousandth. Maybe it will be much
harder to push now. Now you can see it's much, much heavier, but once
it's gone, it's gone. Let's make it 10 thousand, see if that affects anything. There we go. So now because it's so heavy, it's almost impossible for us to push until at
some point we do. Go ahead, have fun
with all these things. Add physics, two
things if you want, you can add physics to all
of these and maybe give them a bit of a push so all
of them start moving around. Although I don't recommend that because whenever you
have a physics body, it takes up much
more calculation than it would if it
was just static. So with that information, I hope you enjoy it and I'll
see you in the next video.
16. Geometry Brush Actors: Welcome back my fellow
game developers to a brand new video. And this one, as you can see, we've created a very, very weird looking castle. The point of this video
is using an brushes and understanding the geometry
of these brushes in order to create levels
in the Unreal Engine. So this is a long video I know, but there is a lot to explain, a lot to understand, and a lot of things to have fun. Let's not waste any more time. Let's get started. Okay, so now it's time to
talk about geometry brushes. The first thing we're
going to do is we're going to create a
new level for these. What I did, I went ahead
and create content. I created a new filter
for the levels, and I found the level that
we were working with, which is the third
person something. I'm going to go back into
content without this, I'm going to right-click. I'm going to create a new
folder and call it B levels. Now again, I'm going to
select the level filter and drag the third person and
to the levels right here. And I'm going to say move there. From here. I'm going to change
this to the crazy world. Hit Enter. Now I'm going to go ahead
and file create a new level. I'm going to select the
default because we don't want it to be empty or any
of these other weird stuff. We want it to be
the default level. Now we have a default level. I'm just going to make
this a bit bigger. So I'm going to
make the platform two-by-two is bigger
and I'm going to change the element on
it from the default one to a basic white. So that way we have a differentiation between
it and the geometry that we're going to add Control S to save it and make sure we are inside of the levels and
call it the Geo testing, which means geometry testing. Save and let's get started. First of all,
geometry brushes are the most basic tool for level construction in
the Unreal Engine, it is best to think of a geometry brush
as a filling in or a carving out volumes in
the space of your level. Geometry brushes can still be useful in the early stages of the product for
rapid prototyping of the levels and the objects. Once you have all of
your brushes setup, then you can replace them
by static meshes that are far more efficient and
less taxing on the system, especially when it comes to the lighting or the
shadow casting, as we've talked about earlier. So first thing we're going
to do is we're going to go into the create and place
the actor panel in here. And we're going to
go to the geometry, and we're going to go through each one of those and talk about the specific values that they have and the commonalities
that they have. Also, we'll start off
with the very basic, which is a box geometry. So I'm going to scroll
down and in here we can see that we
have the x, y, and z, and we can increase and
decrease the size of this box using
these three values. So I'm going to set it
to be five hundred, five hundred by 500. And already you can hear my PC starting to scream and shot. Now, when we click on it, we'll notice that we have in here the option
of the brush type, which can be either
additive or subtractive. What does it mean
to be subtractive? No, it doesn't mean that
it will be invisible, but it means that instead of adding to the
level it will remove. How does that look? Well, if we add
another box in here, we'll put it a bit
inside of this. Or actually let's put
it to the side up here. Once it's subtractive, is invisible and we
lose it very easily. But no worries.
It's the box brush to drag it into the other box. And you'll notice that it carves out a bit of a shape in here. This is what we mean
by subtractive. It means it doesn't
add to the geometry. It actually takes out from it. We'll keep it as it is right
now because we need to talk about the other
things such as the hello. Because we have wall thickness
that we cannot access. But when we click on the hollow, you'll notice that
inside this becomes like a house and it's a
hollow from the inside. When we add a bit
of wall thickness, you'll notice that the
walls becomes thicker. So we can see right here, if we add more
thickness, There we go, you'll see that the wall is much thicker and it's
added from all sides. So now you can see how geometries can be
used to carve out your levels very,
very easily. Why? It takes a lot more
computational power. Because these, for example, this box and wall shifting and wherever are very
taxing on the system. So there we go. We can see that inside we have this cut out because
of the subtractive. A box that we've had. Anyways, let's move
on to the next shape, which is the cone. Once the cone is
added, it has similar. Let me just make this a bit bigger so we can
see it properly. And let's see, Okay, So it can be additive
and we can change to brush immediately in here
to be something different. But let's keep it as the coal. Obviously we have, we don't have the eight sides
of a regular cube. We have the Z height
that we can increase. We have the outer radius
that we can increase. And we also have an inner radius with the amount of sides. So if I, for example,
add more sides, this cone becomes
more a specific, more how to say more accurate, but it will take up much
more resource consumption. So I'm going to turn
it back to eight. Next you have the
align two sides. So if I click on it,
you'll notice we have a slight rotation and
what does that mean? Well, if you look right
here from this side, you'll notice that
the green arrow, let me just go up. There we go. You'll notice that the green arrow is coming
out from the side. If we click on the Align side, you'll notice that it comes out in-between the intersection
between two sides. I don't know how you're going
to use that, but who knows? Maybe sometimes it
will come into play. So let's increase the height. Let's talk about the things
that are not showing. If we hollow out the scone, you'll notice that we have two new options to
play around with, which is the cap z
and the outer radius, I mean, sorry, the inner radius. So if I take another
box added in here and make it subtractive and
drag it into this cone. Now you can see that
it's similar to a hat. So scroll this down
and there we go. So you'll notice
that now we have this sort of a hut and
let's just increase, I meant to increase the
size on the x-axis. So that way we can properly
see how everything is looking and maybe also add
a bit of Z-axis. Maybe not that much. There we go. We can see that we have
this sort of a hut. And this is not
quite what I want. Let me just decrease the size
so we can see the floor. What I can do is I can select this cone and I can increase
or decrease the capsid. And you'll notice that the floor of this is getting lower. If I increase it, then you can see
that it gets higher. So this is the inner Z height. Next we have the inner radius, which should be probably
easy for you to understand. So if we increase the
radius, there we go, you can see that we expand
the radius from the inside, while the radius from the
outside stays the same. Okay, great. Now that we know
how the code works, it's time to learn
about the cylinder and springy much the same
going on from here, you'll notice that we
can make it additive, we can make subtractive. We can change the brush
shape immediately. We can increase the Z. Go, we can change
the outer radius. We can make it hollow, and we can change
the inner radius. And the cool part about the
cylinder is that we don't need to add any other brush
and make subtractive. We can just look from up
here, how cool is that? Now we can change
the inner radius or make it bigger or make it
smaller wherever you want. You can also increase the size
and change the alignment. So you can see right
here, if I zoom out, you can see the green line
once I change the alignment at aligns with this arrow and it
aligns also from this side. You can see it easily. There we go. So it aligns with the axis and
we can increase from a to, I don't know, 13 to make this more circular
wherever you want. So now that we
have the cylinder, it's time to talk about
the curve stairs. So if we add the skirt stare and let's just say I have no idea how the
skirts that works. So what I'm going to do
is I'm going to start looking at the various
things in a radius. Let's increase that,
see what happens. Okay, So the radius
from the inside is increasing while the shape of the stair is still the same. If we increase the step height, there we go to the maximum. You'll notice that the inner
radius stays the same, but the step height
is extremely high. And if I increase
the step width, the inner radius stays the same, the highest stayed the same. But now we have accommodations for any huge
feed that stuck on these. We can also change the side. Why does this keep coming around so we can change the step width. We've already done that. We can change the
angle of curvature. This adds a bit more angular
curvature to our steps. We can increase the
number of steps. Just in case you think it's not hard enough to
climb this wall. And we are actually making
a really nice structure. Next we have the number of. Next we had the option
to add the first step. So if we increase this to one, actually nothing
changes, but usually we can add one more
step down here. See if we increase this
to okay, there we go. So you can see it right here, changing the power
of using extremes. My friends, we can add this
little height right here. There we go. This is the height
of the first step. Let's decrease it back to 0. I don't know how
you would use that. And finally, the last
option is to use the counterclockwise to just flip the stairs and make
it on the other side. So now that we understand the
basic shapes, basic shapes, we still have one thing
that I did not talk about, which is present on all of them, which is the length of the Tesla is best described the right
ear when we use a sphere, because it's not obvious
on the other ones. You'll notice the
sphere is made up of triangles and you can see
that it has tessellation. This means how many, How should I call it the sides? It's best described
on a sphere by changing the amount
of triangles. So if we just simply
increase the tessellation, you'll notice that we
get more triangles and a more or better
defined a sphere. If we decrease it to
one, There we go. You can see that we
have a very bad sphere while on the queue. Increasing or decreasing
data isolation doesn't really do anything, so just keep that in mind. Now for your challenge. Your challenge is going to
be to explore and build. So first of all, explored
the last two geometries, which is the linear stairs
and the spiral stairs. They can anything to the
overkill or the extreme, build out a level
you can imagine. Use the shapes we've learned. Use this level
that we've created to create a very different level using the geometries and use these shapes in
subtractive ways. Finally, keep the
level for later, we'll be using it in the future. So pause the video right now, go test out the new
stairs and finally create your own level
using the brushes. I'll see you in just a bit. Hey, welcome back. How did you get on that? I hope you had as
much fun as I have. One thing I forgot to mention is when you're editing it
in the orthographic, you might have noticed that the subtractive are all in red, while the additives
are all in blue. So this is my structure
from the top. Let me show you the
structure from the front. There you go. How cool is that? Aren't you excited to
see what I created? The perspective? There we go. So now you can see this. I don't know, nothing
too fancy in here. I've added a cylinder
or something. It's a cylinder,
made it subtractive, added a huge cube,
added these stairs. I also added the cylinders
with cones on top of them. And in-between those parts
that are missing and floating in the air
are things fears, yes, spheres that I added. And as you can see, I did not test my game enough because I cannot
step on these steps. Well, thankfully,
if I go out, okay, So actually I cannot
do that right now, but let's go ahead and try
to get to the top platform. Anyways, this is not the
point of this video. The point is that you
created your own level, and if you want to share it, you can go to the
score and share it with your fellow
game developers. They're using the link. And one of my descriptions, if I think this game is
harder than it looks anyways, I hope you enjoyed
the video and I'll see you in the next one.
17. Components Sub Objects Within An Actor : Welcome back, my fellow
game developers. In this video, we've
created a cube made out of sphere components with
light components on it. And not only that, we also added a
projectile components. So now as you can see, this cube flue towards the wall, and once we hit it, you can see that
we can affect It's movement because we've hit
one of its components. And if you don't believe me, there we go, we
click on the cube. It's only a single
actor in the world, but it has several actors
as component on them. So let's not waste any more
time and let's get started. Okay, so now let's
talk about components. A component is a piece of functionality that can
be added to an actor. When you add a
component to an actor, the actor can use the functionality that the
component that provides the component must be
attached to an actor and cannot exist all by itself. And you can see the
components right here. Whenever we look in the
details, for example, the floor doesn't have
any other component than this Static Mesh
Component that it has. When adding a
component to an actor, you are putting
together the bits and pieces that will make up
that actor as a whole. So you're actually
creating one actor out of, if you want to call it
like that, several actors. How can we understand
this better? Well, let's imagine a car. So if you have a car, usually it's not just a car. The sum of its components
are called a car, but it has a wheel component,
four wheels component. It has the body component, it has the light component, and it has its eyes which
are camera component. So all of these form the
component of the car. So all of these
bits and pieces of the car make the car it's
not the car all by itself. It's not one single huge piece. It's a collection of components, hopefully that made things a little bit easier
to understand. So let's go back into
our p.sit Unreal Engine. I'm going to go out
from here because this level keeps
my fans screaming. I'm going to create a new level or we can use our crazy level, but I'm just going to create
a new one, a default one. Save the selected one. And let's just make this
one maybe five by five. There we go. So we have a big platform
and we'll change this to a basic white
material. And there we go. So now I'm just going to
move this guy back in here. And let's talk about what
we have as components. Solve, for example, you can make an actor a component
of another actor. For example, I'm going
to add a Cuban here. So this is our q, and I'm going to make
it a bit bigger. So we're going to
increase on the X, increase on the y increases
around the z-axis. And then in here, as I've said, we can add new components by
clicking on the plus button. Once we click in here, we can see that we
can add a sphere, which is a static mesh
component once added. Now we have a little sphere. There we go, right
next to this box. But not only can we
add another shape, but we can also go
ahead and add a light. So I'm going to add a spotlight. And notice that the
hierarchy has changed. Now the spotlight is the
child of the sphere. So now when the sphere moves, regardless, spotlight
moves with it. Now why did that happen? Well, because when I clicked
on the Plus Add button, I was selecting the sphere. If I want to set something
outside of the sphere, I need to select the
static much component, which is the root components. And every single
actor in the world, whenever is added has
always a root component. It doesn't need to be the
Static Mesh Component. It can be any other component, but right now it's
a static mesh. I'm going to rotate this sphere 90 degrees,
and I've turned off. I'm going to set it to, this. Seems good enough. Then right here,
move it up a bit, and let's increase the spotlights
luminosity or intensity. There we go. We're going to maybe make
the attenuation radius. Nope, not that. Let's decrease and make
the light color red. We'll talk about
lighting later on. Increase the intensity
again to its maximum. Then maybe decrease or increase, and move the sphere of paper. There we go. So it
covers the whole square. So now when we
play, There we go. We can see, there we go. We can see that we have this
red light over the square, which is coming out from
one of its component, which is a sphere. And you'll notice when
we click on the cube, we cannot see the components. And they also work
in similar ways to the parent and
child relationship. As you saw when we were
moving the spotlight on the sphere and spotlight
was moving with it. Now these components
are actually static meshes that can
survive on their own. Let's take an example
of a component that cannot survive on its own and it's going to be your challenge. Your challenge is to create
a projectile or something. Go ahead and create an actor
with several components. I recommend creating some sort of sun was moons around it. And then these can be
anything you want. Just make sure you have
at least one shape, one shape, and then
another one next to it. Then add the projectile
movement component to it, check all the properties on it. So the properties
on the projectile movement and suddenly
initial speed and the maximum speed, so that when you start the game, the actor starts
moving and I will drag them and that adding two
walls would be really nice. Just saw we can capture the projectile while
it's speeding. So pause the video right now
and go do the challenge. Okay, welcome back. So I'm going to go ahead
and duplicate this sphere. Since I already have it. You'll notice that I
don't have a spotlight, so I'm going to go ahead and duplicate the
spotlight the way we do it, it's simply hold down
Control W. There we go. We get to another spotlight. Added there. Select the spotlight and
let's reset the position. It's going to be
reset to the sphere, which is very convenient. And then I'm going to
rotate it up 180 degrees. So now we have
lightning from down, lightning from the upside. Now I'm going to select both
of these spheres right here, and I'm going to duplicate them. There we go. Okay, not like that. Maybe we'll select them
and Control W naught. We still don't get
the spotlight. No worries about that. We'll simply will simply
duplicate the spotlight added to force V4 and duplicate the
spotlight again out of five. And all of this is just for
me to have a bit of fun. Let's reset the position. There we go. 00. These fear for whereas
this view for key, obviously it did
not reset properly. For some reason. Can you go down
please? Thank you. Now we're going to take the
sphere and we're going to rotate it by 90 degrees. There we go. And the final sphere, which is here, and we'll
just rotate it like that. There we go. Now we have these four spheres with
spotlights shining on them. So there we go. Not bad. It seems good enough. Now I'm going to go into the cube and I'm
going to go ahead and add a projectile movement. Now we have a
projectile movement and this does not live by its own. It always needs to be a
component that cannot survive without being attached
to our cube right here. What did I say? We
needed to change? Let me checks at the initial
speed and the max speed. Okay. Then initial speed, let's increase it
to, I don't know. Let's make it 700
seems good. Max speed. Let's increase that as much
as we want. And there we go. So now it should be flying. Let's just play and
see what happens. Yeah, Seems like
that didn't happen. That's because we have an error. We need to set the mobility
so you can see it right here. Sorry for the inconvenience. I'm going to go
back into this cube right here and make sure
to set it to movable play. And there we go, you can
see that it fell down. And I'm going to also
simulate physics on this. I'm going to go ahead and
create another shape, which will be a cube. That's not very good. I'm going to set it in here. Let's go to the top. We can
see things as more properly. Our king was confused
there for a minute. So let's go ahead and increase
the size of the swallow. We gonna build a wall. Sorry for that. And now we're going to go back to the left. Increase the size like this, make it on these that axis. And now we should see a pretty
good wall. There we go. The Plachy bam, you can
see that it interacted with the wall that I
want to make it a bit faster so we'll set
the initial speed. And these are just things
that I'm playing around with. Okay, so you don't have to actually look at me
while doing all of this. I'm just having fun. So I
hit Enter the Play button. Bam. Okay, so there you go. You can see how that was moving. Not very good. Let me
turn off the gravity. Maybe it will make
things better. And let's see, should we
change anything else? Maybe we can make
it more bouncy. Anyways, that's
for another time. Just hit splay, boom,
and there we go. So now it's flying around. It's coming toward us. And then look how cool is that. So we've affected our little
spinning cube gland it. So I hope you
enjoyed this video. I hope you have a
better understanding of components and I
hope that you are always trying your best when doing the challenges
because as you can see, I always help you out. I'm always there to then
finish the video with you. And how cool is that shot? I wish there was a sunset. Well, don't worry, because
in the upcoming videos, we are also going to learn
how to create a sunset. Them. Thank you, Michael, Amazing. I'm getting tired. So see you in the next video.
18. Volumes Reference: Welcome back my fellow
game developers to a brand new video. And this one, as you can see, we created a space where
we move a bit slower. We created a space that
we completely stops us. We created a space that makes the space
around us very weird. And we created a space that
kills us instantaneously, actually give this as a fire that gives us instantaneously. So let's not waste any more
time and let's get started. Okay, So volumes, we've already used volumes
in a previous video, but now it's time to delve
up the deeper volumes are three-dimensional actors used to alter the behavior of
areas within the level. Volumes can be used
for behaviors like the common volume
behaviors causing damage to the player or other
actors inside of a volume, which is very
helpful whenever we are testing out our health. Blocking certain
actors from entering the volume acting as
a collision surface. For example, I don't know
if we don't want the player to escape from a certain
level or something, opening a door when an actor, and there's a certain volume. So let's say we want
to be able to open the door only if the player is standing in
front of that door. We add a certain volume actor that trigger or that
allows us to trigger the door opening and changing the way a level calculates
the lighting visibility. This is done through
the post-process, as you saw a couple of videos
ago when we deleted it, the environment
changed a little bit. Now let's go ahead and
create a couple of volumes. First of all, creating and placing volumes is very simple. We're simply going to use
the volumes right here or we can set the place
actor and just add volumes. Not going to set the place actor because it's a bit cumbersome. Some volumes can be
created by selecting one of the volumes from
the Value tab right here. And once the volume
has been added, it has a place in the level. You can resize and reshape it. So let's go ahead and add, for example, a Physics Volume. If I add the Physics
Volume right here, you can see that it
has its size and similar to the
brushes that we've added a couple of videos ago, we can scroll down and change the size using the x, y, and z. We can also make it
hollow. How cool is that? So all of these
things are similar to the way brushes, work. Volumes are support actors
generally used to detect when certain actor types have entered a specific area and
trigger an effect. The nurse and response. For example, the
bank causing volume. If we add one, Let's see, where is it the bank causing
volume which is right here. Just increase it. I'm, I'm just gonna
change the scale in mind. When we change the scale is the size of the box which
is here stays the same. So just keep that in
mind if something weird happens whenever
you are playing the game. The pink causing volume causes damage to the player
every couple of seconds. And we can change the way
it damages the player by accessing the different
properties that it has. For example, we have
the Pain Causing, doesn't cause pain or not. Well, if you don't
want it to cause pain, then it's pretty much useless. Now I'm just getting the point of this having been
true or false is if we want to trigger it after the player stands on
something specific, then we have the
damaged for a second, the damage don per second
to the actor inside of the volume when the Pain
Causing is enabled obviously, then we have the damage type. Does this determines the type of damage the actor can take. Currently, we don't
have that much, but you can create
your own damage type. This is a bit advanced, but it's good to know. So for example, you can create a spike damage type or narrow
damaged or a bullet damage. So all of these can differ depending on what
functionality you want. Then you have the pain interval. So this is the amount
of time in seconds between applied damage when
the Pain Causing is enabled. And finally, we have
the entry pinpoint. This determines whether or not the damage is
applied immediately upon entering the volume or after the pain
interval has passed, this is an additional damage, so keep that in mind. Next we have the volume, Physics Volume right here. And this will affect the way our player or character moves, moves through this
physics volume. For example, we have the
terminal velocities. This determines the terminal
velocity of the pond. If you don't know what
term terminal velocity is, is the maximum speed that
any object can fall because, you know, all add objects
no matter the size. Size Actually, no matter the. A weight of them fall at a certain maximum
speed because of the way they are of their size. This changes the maximum speed that the bone can fall off. I don't know why
we would use it, but it can be something
like maybe inside of water. Then we have the priority
which determine which Physics Volume takes
precedence if they overlap. So if you have
water and you have oil inside of that water, so which one has the priority? You have the fluid friction that determines the amount
of friction applied by the volume as the bond is moving through it
using its movement, we have water volume, which determines
the volume contains water and you have
what else do we have? Anything else? No, that's it. We also have the physics on contact which determine
if the actress is affected by the volume
simply by touching it or if he needs to be
completely overlapped by it. So let's go ahead
and test this out. So let's say the fluid, Let's make it water volume. And let's make this about, I don't know, let's make it
three and see what happens. So when we play, we walk
towards and there you go. You can see that we are slowing
down once we're outside, we are very fast-moving. But if we're inside,
there you go. You can see that because
of the friction, we are moving slowly. Now, why do we have
that jump? No idea. Anyways, you can see
that we've jumped. Next we have the Spain
causing volume in here. But, well, nothing
happens because we don't actually have any health. Now one thing to keep in mind
and that is that the player right now will not know how to avoid this Pain
Causing Volume. You as a designer needs to
always keep in mind that you need to add some
kind of particle effect, fire spikes, whatever
it is to make sure that the player who's
playing your game understands that there is. I don't know. You can add a cloud of
poison, for example, and make sure that the
player knows that there is pain there if he walks through
the, through, through it. Anyways, there are a lot and locked and
unlocked on volumes, as you can see right here. We are not going to go over all of them, just some of them, and some of them you
are going to explore my yourself at some volume. I hope you understood the joke. Anyways, add a blocking
volume and see if you can move through it at
the kill zone value, just like we did previously, and see if you can
move through it. Add that kill zone
at two that goes on a particle system
component and set the template property of that
particle system to be fire. So pause the video right now
and go do the challenge. Okay, welcome back. So I'm going to just keep the Pain
Causing volume. Why not? It doesn't bother us. And I'm going to go ahead
and create a new volume, which is going to be
the blocking volume. We're just going to
put it right here and just maybe make it a bit
bigger, 700 to that. So now when we play, can we walk through
it? No, There we go. We are stopped by an
invisible wall. Excellent. Now let's go ahead and
add a kill zone volume. That I go. Kill volume. Let's increase its size
a bit or no, actually, let's keep it the
same size because we are actually going to
add a component to it, which is going to be
a particle system. That particle system is going
to be fired on that fire. We're going to change
the template to fire. There we go. This
far is a bit small. So what you can do
is, for example, increase the size of that fire. Where is it? Why is it not increasing? Increasing the size
on the x-axis, on the y-axis, on the SAT axis. Okay, so I think that's
far is good enough. So now when we play, if we walk through
the fire, bam, we die, we immediately
disappear from our level. One other thing I
wanted to add is the post-process just to
show you how it works. So I'm going to go ahead
and create a volume, search for the post
process volume. And I'm going to set it in here. And I'm going to increase the
size like that, like that. Just move it right
here and there we go. So now it's behind the player. What I'm going to
do, as you can see, we have a lot of options when
it comes to post-process. And it really takes a very good scholar vision in order to change
all of these effects. But I know a couple of them. So I'm going to
add, for example, a bit of blue intensity. I'm going to increase the blue. I'm going to add some
chromatic aberration and increase the
intensity to run a no to. And I'm going to also
add some mountain know what intensity that. And now I'm going
to play the game. And if I walk
towards that volume, wow, how cool is that? You'll notice that
now everything is very weird and the world
around us as lagging. I've added this widget. And why is it when I'm
turning, is it not working? Or if I'm actually outside? Well, because this depends
on where the camera is. And you'll notice that
our third-person, oh, by the way, even if we move during
gameplay inside the width, we can also see, you can see the chromatic, these three little colors, and the widget is deep
black around the camera. So I hope you
enjoyed this video. I hope you like the way
these volume works. Let's Control S to
save the level. And didn't we save this level? Go anyways, GO. Really, I'm sure that
we save this level. No worries about that.
So GO volume testing, we'll call this, save that. And now we have, okay, so we were in
a different level. How that happened. Not whereas about that. As long as we learned
something new, I hope you enjoyed
this video and I'll see you in the next one.
19. Materials : Welcome back, my fellow
game developers. In this video, we are going
to learn all that is, there is to know about
materials as you can see are crazy world is
much more colorful. Oh, no, oh my God, we are almost done.
No more blend. Q white cubes. Now we have colorful cubes with the material with
different surfaces. Were they crazy, scary world
to be honest with you? So let's not waste any more
time and let's get started. Okay, So materials,
even though materials, I'm not actors and
in this section, we are more focused on actors. You already have two
amazing worlds and it would be really shame if
you keep them this plan. So we're going to use
materials to make our levels much more beautiful
and add life to them. First of all, let's
talk about materials. What are the, a couple
of key concepts that we need to understand material. A material is an acid
that can be applied to a mesh to control the
visual look on the scene. And then we have the textures. All the textures are images
that are used in materials. They are mapped
to the surface of the material that is applied. Just to get those two
things out of the way. Now let's go back
to Unreal Engine. Immaterial is an asset, as we said, that can be
applied to any mesh. And we've already seen how
that looks at a high level, it is probably
easiest to think of a material as a paint that
is applied to an object. But even that can be a little misleading since
materials literally defined the type of
surface from which your object appears to be made. You can define its color, how shiny it is, whether you can see
through the object, which we'll do later on in the course and much, much more. Let's start adding a material
to the surface of a brush. I'm going to go back
to the geo wherever. What did we call it away. That's okay. So now, now I remembered
the previous video. I had a bit of a, this is the volume casting. I'm going to change it. I am starting to go crazy. So yeah, midlife
crisis about to start. So I'm going to move
this two levels. Inside of levels. We have the crazy world
and the volume testing. Okay, so after a couple
of minutes of searching, I realized I had made one
of the biggest mistakes. However, for some reason, overrided the level
or forgot to save my level that had the
castle and whatever. But that's okay as long
as you have yours, it will not deter us from
our goals of learning how to add material
to certain niches. So let's continue on. The first thing that
we're going to do is we're going to go ahead
and drag a machine here. And I was wondering
all the time, where did that thing go? Anyways, big mistakes. No worries. We always make mistakes as
long as we admit that we made them and we try
to do better later on. But for now, let's
look at this cube. So what can we do to the skew? We can go in here, select materials not levels, and we can go ahead and for
example, add this text. And when we drag it, we put it on this brush. And you can see
that we only put it on one side of the brush. And this is what I
meant when I said that it's not simply a
paint on the wall, it's actually the way we see it. So you can see the way the surface reflects
and challenges scholar. And you see that
you can almost feel the depth of these little
wrinkles right here. So you can see right here the shadows being
reflected on this side. But once you move to this
side, we no longer see it. You see a bright
shadow right here. So all of this is
part of the material. That's why it's much more than simply painting on a surface. But now that we've added this
to one side of the brush, what if you want to add
it to another side of the brush while you can go
ahead and drag again one here. But that is not that
efficient wall, but looks really nice. Anyways, you can see also
how it can change colors, so materials are very powerful. Now, what we can do is
we can select one side, hold down Shift plus b. And now you can see that we've
selected all of the sides. And now we can simply drag in one surface and all of these
surface have been added. And you want to understand
where we got this shift B, you can simply
click on the brush. You can go into properties
to the geometry. Geometry. And you can see right
here that we can select the select matching brushes
by using the Shift B. And there are many, many other selections that
you can have. Geometry. The properties of the brush. And the last way we can
simply select one of the surfaces and we can
go ahead and select, for example, the walnut
or something different, for example, the water
lake and whatever. So you can see how
the surface is moving because this
is a water lake. This is not simply a
painting on surface. It is at the actually has
life and purpose tool. So now that we've learned how
we can add it to a brush, Let's learn how to add it
to a static mesh component. This is much simpler. You simply take
with the material, drag it on here,
and there you go. You can see that the
material, it has been added. But there is another
trip that we can do. Let's suppose we want to
apply a material of all, let's see the material of this cobblestone we
want to apply it to, I don't know, a linear stair. We can either add the stair
and then add the material, or we can select this cobblestone and then
simply drag a linear stare. And you can see that
the linear stare immediately has the
cobblestone on it, which is very cool. And let's see if we can do that. The same thing with shapes. So we have the
cobblestones selected, let's choose another one, drag in the square, but this does not apply well, because it's a fairly simple to simply drag it onto the surface. So with that knowledge, let's talk about textures. Textures are something
that is very advanced. And if you look right
here on the element, you can see this little texture. And we can actually select
the texture and go to it. If we double-click on it, we can open up the texture. So this is called the
normal, I believe, or the roughness, which gives
us the surface roughness. So keep in mind, this is
a very, very deep topic. And when creating a game that looks textures and materials, use a whole different department of artists and
graphic designers, which I am not complete honesty. So these are image assets
used in materials to apply to a surface or to draw
on the screen or the hub. The most important part, textures are created externally within an image in
imaging and editing, image editing application,
such as Photoshop for example. And then it's imported into unreal or into some other pro, 3D designers such as blender. A single material may
use several textures. As you saw, we have this
texture for the roughness, but we also have a
texture for the granite. Whereas it, so there we go. So we have this
texture also follow the granite and
different ones as well. With that out of the way, the final thing I want
to talk about is a mesh, static mesh that might have
several elements to it. So for example, if I scroll down and add one
of these stairs, when I add the stairs, you look at the material
right here and you can see that we
have two elements. One for the right here, step at the top, and one for the surface
in-between the steps. So for example, I can
change this material and set it to be clay and change this material and set it to be add on all some would do
something if I can find it. You can change it to any
material that you want. Let me try to add some
kind of materials, so maybe just make it flowers or whatever.
So there you go. You can see that you can
change to materials on the same static mesh whenever that Static Mesh not deleted, whenever that Static
Mesh is complex. And actually I'm going to select one of these
woods right here. And let's say I've
selected this, I can drag it into the surface. Or while selecting, I can go to the element right here
and use. There we go. So we can see now that has
been applied and we have a really nice-looking stair with all of that out of the way. The last thing that I wanted
to talk about is whenever we have a special
property on the brush. So I'm going to select the cobblestone and
actually know what. Let's select this one, Shift V. And let's go ahead and
apply the cobblestone. Let's look at this brush one. We select it and
scroll down until we find surface properties. Surface properties. There we go. It was closed. So we have the pan, the rotate scale, and
a bit of lighting. So the pan, the bottoms in this selection
allow you to pan the texture of the
material either horizontally or vertically
by any given number. So once we start clicking, your noticed that they
are moving to the right, we can increase the
amount of movement that we have and we can
also set a custom one. Then we can also move them down. As you can see right here, we have the rotate, which rotates the texture. So there we go. We can set it to 45 degrees or we
can set it to 90. And we can also flip. These are very helpful
things to keep in mind. And finally, we have the scale and keep in mind that the scale uses the u and v instead
of the x, y, and z. We can, for example,
scale three on the, on the you and apply
that. There we go. We can see that the
cobblestone has been smashed. Anyways, with that
out of the way, I'm going to issue you
a bit of a challenge to add materials to your world. Now that you have
the weird shapes and the floating cubes add materials to all the
surfaces and static meshes, Static Mesh actors
and the world. And do the same for the
geometry that out level which your instructor has
stupidly. I don't know. I don't even know if I deleted it or if I for some reason, I think when I created a new level to test
all the volumes, I did not save. I don't know To be
honest to how I managed to do such in state, but let's not worry about
that as long as you have your level if you follow
the steps, I did exactly. And you deleted your level. I take full responsibility.
I'm very sorry. So pause the video right now
and go do the challenge. Okay, welcome back. So my fellow game developers, it's time to add materials
to all of these shapes. Well, it's going to
be able to cumbersome because I already
have lots of these. So what I'm going to do is I'm going to select all of
these shapes almost. Let's see. Oh my God, we have so much. I'm not going to go and do
every single one of them. I'm just going to select most of these nano up almost
these also these. And we're going to
use SI materials. The geometry, Let's select,
Let's select this one. This is too hard. Select the normal lake
water also, the wood. Now that we've
selected the woods, we can scroll down in
here and set all of these elements will
transport selected. That's okay. So selecting another
bunch of elements and we'll set this kind
of Woodbine on them. Bam, there we go. Now I'm going to select
another batch of elements. Maybe set that to be. Okay, Let's set it as this one. It seems good enough. Wherever is material that I
select something weird in hears that mesh values material. So we have displayed
to materials. Now let's just replace
this, these ones. Okay, great. Everything looks good. Let's select the rest. Right here. We'll add this one of the chair. Yeah, sure. Why not? We have a different materials and we'll select just
the ones in the white. Select the other ones. And we'll make them. I think this is gonna
take a long time. I hope you enjoyed this video and I'm sorry for
the mistake again, I hope you didn't
delete your level like I did and I'll see
you in the next one.
20. Lighting the Environment: Welcome back, my fellow
game developers. In this video, we are
going to be learning everything there is to
know about lighting. So at the end of this video, I will issue a challenge
and then tell you, I'll see you in the next video. So this is the result
of the challenge that I created when we hit
play. There we go. You can see because of the
material that I've added, these are still lighted up. But now when we move
throughout our level, look how cool this
looks, at least for me, I think it looks really nice
because we move from blue to complete darkness to then having read
on us than green, which really makes
your level seem as if there are a lot of
things to do in here. You can see I've added a
bit of red to the heart. So nothing too fancy
to be honest with you. I know it's not
like revolutionary. Probably you created
something much nicer, but this is just for you to
have a bit of inspiration. So let's not waste any more
time. Let's get started. Okay. So remember last video or a couple of videos
ago, I don't know. I lost my g or level. Well, for some reason
it's back here. So that's great news. I guess. I don't know why it's beer
that's probably a glitch because of the early access
and Unreal Engine five. But just in case
something happens, Do you like this? Simply restart
your Unreal Engine and it should come up again. I've been facing these
problems a lot Plachy. Anyways. Let's not
worry about that. Let's worry about lighting
in the Unreal Engine. So I'm going to go ahead and
create a new level in here. This level, or
actually I'm going to create from here this new level. It's going to be an empty
level because we don't want any lighting in our world. So let's talk about
the basics of lighting and explain a couple of key concepts before we start. First of all, we have lumen. It's the unit of luminous flux. So the lumen is the SI, which is standard
international units, derived unit of luminous flux, a measure of the total
quantity of visible light emitted by a source
per unit of time. So basically, for example,
when we measure weight, we use kilograms or if you're in the imperial
system, we use pounds. In the case of
light, we use lumen. Then we have the specular scale. This is something that we'll see in just a bit and it's
a very advanced topic, but I just wanted to give you
a broad idea of what it is, It's relating or having the
properties of a mirror. So how far off the light
reflects on a mirror like surface will see a lot of mirror like surfaces as we go
on through the course. Anyways, with that
out of the way, let's go back into our Unreal Engine and
let's see what we can do. As you can see in
the World Outliner, we don't have anything. It's completely
and utterly empty. So we're going to start adding a couple of
things in here. First of all, and Unreal Engine, there are a number of
ways of adding light. We've seen. There are a few key
properties that have the greatest
impact on the lighting. The way we can add lights is
simply by going ahead and creating glides from here so
we can add a point light. But as you can see, there's still nothing where
you might be thinking, why is there nothing at all? Well, because we need something to reflect
off of that light. I'm going to go ahead
and add a cube in here. And you can see
that it's far off. So I'm going to reset
the cubes position, and I'm going to reset the
point slides position. Focus on that and then
move this up and they're regards on now we have our
cube being illuminated. What I'm going to do is
I'm going to set this q. Let's make this bigger and
move this up a bit also, I'm going to make the
skew may be five-by-five. And actually you know what, let's make it 100 by 100. Yeah, so now we have
a huge canvas to work with and understand
what's happening. Let's continue on the
other way of adding lights as by simply
using the place after Going to the lights filter and just start adding
lights from here. So once the light
has been added, you can then adjust
the position, the rotation, and the scale. So you'll notice that in
here we have the position, the position on the
y and the rotation. Obviously nothing happens
when we rotate a point life because it shines the
same in all directions. But if we have a
spotlight, for example, and we do a bit of rotation and all that
kind of rotation. But this kind of rotation. This again, there we go. You can see that we can
change the angle and we can change the angle
also on the x1 direction. So all of these can be adjusted
and lights are usually represented by these
little sprites right here in the editor. So as you can see, this is swan as
for the spotlight, and this one is for the 0.5. Okay, Excellent. And
notice also we have the spheres are out there that we'll talk about in just a bit. But before we do that, we need to talk
about the density. If you look into the details, you can see a property
that is the intensity. And this determines
how much energy the light outputs
into the scene. For example, for a
point-like any spotlight, the intensity is
usually in lumen. What do I mean by that? We have this little
point like right here. And you can see the sphere. Sphere is how much
it can influence, which is the attenuation radius. Just wait a bit and
we'll talk about that. If we increase the intensity, you'll notice that it's entire, almost entire circumference
has been set. While if we decrease
the intensity, you'll notice that it
goes to 0 eventually. We can also change the
color of the light. So by clicking in here and
you can see that we can change how the
scholar looks with, which can add a
lot of variety to a level that you are
trying to create. Next, we have the
attenuation radius. The attenuation radius of the light does a
few majors things. First, it sets the
reach of the light. Second defines what
objects will be affected. And finally, it serves as the outer bonds when calculating the fall
off of the light, what do we mean by
fall off the light? That means how far does the
light effect what we see? For example, if I
increase the attenuation, you will notice that this
circle of light increases. And if I increase the intensity and I increase the attenuation, I can keep going
and going until we affect the maximum amount. And what's the follow-up
while the fall off? If you scroll down, you'll notice that we have
this very bright middle Spark, which is the sun, if you
want to call it like that. And then we have this
outlet outer radius and notice everything
inside this orange. And then we have the red, and then we have the
complete darkness black. So all of that affects
our life inside. So I'm going to
reset this to eight. And I'm going to go ahead and
create a life that is 200. And you can see that we
barely see anything. So I'm going to drag one here. And how big is the surface? Okay? I'm going
to make this one, actually, let's make
this one bigger. So I'm going to make it 400. I'll make this 1800, make this 11100. There we go. You'll notice these are three varying degrees
of attenuation. And keep in mind that we
kept the luminosity or the intensity on all of
these three lights the same and this is the same
one applied on a point, I mean a spot light. So the light
attenuation radius can have a serious impact
on the performance. Obviously, you can already hear, I think the south of my fans going around because we are adding
a lot of things. Next we have the, let me just point by point. We have the source radius. The, all of these things can affect the way the
light behaves. I'm not going to go too deep. Because from experience I
understand that most students aren't as interested
in lighting as they are interested in creating
a game using lighting. But please feel free if you
think this topic interests, you go into every single detail, understand everything, and
see how all of that works. I really do encourage you. It's saying amazing
topic and trust me, if you can create a nice
lighting seem to gain, you can. It's like it's the
difference between a mediocre game, I
incredible game. With all of that out of the way, let's talk about the
different types of lights. We've seen. The points
lie pretty obvious. These are similar
to light bulbs, so they emit light in all
directions from a single point. We have the spotlight, just like we saw earlier. We add a spotlight, that's the mudslides light in a single point from
a single point, but it has a certain direction
and it is gone like soap. If we scroll down, you'll notice that it has not only the rate of
generation radius, it has the inner cone, and it has the
outer cone that we can manipulate and
change the color of. Obviously, there we go. You can see that the
color of the sprite that represents the light also changes when we change
the color of the lines, or this is something
to keep in mind. For example, if I
increase the outer cone. Just like that. And move it up a bit. Anything increases
the attenuation. There we go and increase
the intensity. There we go. We can see that we can
also create this kind of light attenuation like, I don't know what
you want to call it. Next, we have the
rectangular light and this is something
that is usually used inside of
rooms. I don't know. I've never to be honest, use it, but it's very important to understand because
look how it can be manipulated and
changed the realm now will become sort of a, it's like a projector when
if you have a projected different a bit different than a spotlight and that
it doesn't Project a, a cone like projection, but you can put it in
here and just use it. You can see that it
does not generate any light from behind. It just has square lighting. Next we have the
skylight which captures the background of your scene and applies the lighting
to the meshes. This is something we'll
see later on as we apply atmosphere and
clouds and all of that. So basically the skylight is like when you have a mountain, for example, and lights shine on that mountain and that mountain reflects light back to you. So that's what's called
the sky lighting like big, huge object or the atmosphere actually reflecting light
back onto your object. This week, we will see you
in the next video of this makes shadows much less dense. And finally we have
the directional light. So when we add the
directional light, you'll see that it
shines over everything. And directional
lights are primarily used as your outdoor lighting or any lights that need
to appear as if it has been cast from an
extreme infinite distance, which is usually the sun. With all of that out of the way. I know we haven't
learned too much and look how all of these change. We can adjust these lights so we can decrease and increase the lux intensity on the directional light depending on how you want it to look. We can also change the angles. There we go to make it seem like a sun, sunset or whatever. Later on we'll learn how to use these all in a better,
much better way. So with all of that
out of the way, I'm going to issue a small charge to create
your own lighting. Duplicate your
crazy world level. We move all the elements relating to lighting
up the level, create your own lighting
on the structure. You can do the same for your NGO level though I
don't recommend it because already there we will
using geometric shapes which take a lot
longer time to render. And then you're adding a lot
of light into that level. I don't think it will
be a good combination. And use different flights and different colors
depending on your system. This might be very
taxing or pretty simple. So mused, light sparingly, play around, have fun. Enjoy your time. Try to
use as little light as you possibly can and keep in
mind all the attenuation. But that information,
I'll leave the creation, the creativity to you, and I'll see you in the
next video where we will learn about the
atmosphere and the Cloud. So see you then.
21. Atmosphere and Clouds: Welcome back my fellow
game developers into a brand new video. And as you can see, or maybe you just don't know. But this is a world that
we've created all on our own. You'll notice that the
clouds are a bit different. The environment does
have a different, the angle of the sun is
also a bit different. So we've been changing
all of this up. We've been testing our game out. We've been playing around
with the atmosphere, the Cloud, with the sun,
with a lot of things. So this is a very
exciting video, but let's not waste
any more time, and let's get started. All keys. So now that we understand
how lighting works, it's time to understand
how the atmosphere and clouds, clouds to work. So I'm going to
go into the file, create a new level, make sure that it's empty. Save everything in here. This will be our testing or atmospheric
creation and clouds. So first thing we're
going to do is we're going to start off by
adding a directional light, which is pretty simple. So when Steve directional
light is added, you will see that nothing
happens because we don't have anything to actually liked. So I'm just going to simply
create a Cuban here, put it in the middle
of the middle and make it 1 thousand by one. Okay, so everything is
11000, that's great. So whereas the
cube, There we go. So the cube is everywhere I think all because he made
it also in this direction. So I'm going to unlock this and make sure it's
like one in here. Okay, great. So now we can
see our cubic properly. Excellent. The next thing I'm going
to do is I'm going to add a sky atmosphere because
everything right here, it looks very dull. So I'm going to go in here. Let's add this and just
search for Sky atmosphere. Once this guy atmosphere
has been added, you will notice that
nothing at all happens. But if I select the
directional light, I find the atmosphere sunlight. Whereas it, at most fear
sunlight when I click on it, you'll notice that now I have this amazing looking atmosphere with a little sun in the middle. Now, how does the sun work? It's not just for props, it actually moves
and it actually determines how the
directional light will work. So if I select the
directional light, you'll notice that it's
at a certain angle. So on all this, what happens
when I decrease the angle? There we go. You can see that
we can create this little neat looking at I don't know what
you want to call it. At sunset maybe. Yeah, sure. Looks like a sunset. So now let's add another
Cuban to our level, which is a fairly tiny cube. I'm going to zoom in on it
and just move it up a bit. So notice notice how the
shadow is not just dark, it's completely,
completely black. So what we're going to
do is we're going to go ahead and add something
called a skylight, which we've talked
about previously. And notice how
everything changes, literally everything now
the shadows look more like shadows and not just some
kind of void of abomination. I'm going to select
the directional light because we're having
a bit of trouble. The urine just like in just a little bit of increased just to make everything
much, much smoother. There we go. Now, we have a lot of properties when it comes
to the sky atmosphere, when it comes to
these sky lighting, and when it comes to the
directional light also. So I'm not going to go too
deep into that as I've said, because most students don't
really care about the light. And I honestly, I'm not
a professional at this. I'm going to leave
a couple of links. And if not, it's going to be part of the
description of where, where I'll teach you how
you can find everything. The next thing I'm
going to add it a bit off clouds so you can see that everything is pretty empty. So I'm going to go in here and I'm going to add
a sky atmosphere. Once dragged in,
I'm going to search for volumetric,
volumetric clouds. There we go. So when I add the Volumetric
Clouds, There we go. You can see that now I have
really nice-looking clouds. Now one thing when I zoom out, you'll notice we're still
in this avoid right here, but we'll figure that out. So now you can see that we have these clouds in the air and
we can tweak a lot of things. We can change the,
the layer height, how high the clouds are, and all of that good stuff. We can change things, stop if you go down into it. You can even change the
color of these clouds. But of course not that easily because clouds are also have their own very weird
things in them. I also leave a link that she can go to and look through
all of the clouds and see how you can adjust them on your own and
customize your clouds, which seems very cool. You can also use the
tip to the max level, which is always the preferred method
of discovering things. There we go. So immediately
I understand that this makes my clouds a bit
more dark in those. I didn't even look
at what it is. Okay, great. So the last thing I'm going to do is go to the
directional light and I want to add shadows to
the Cloud SOC gas, shadows. Shadows on clouds. It should be guessed. Shadow on clouds. Let's see clouds. Okay, there we go. So add a bit of
shadow to the clouds. And on the skylight, I'm going to select
it and I'm going to look for the
real-time capture. Select that, and
this should make all of the shadows
a bit more smooth. There we go. I'm going to
make this a bit bigger. There we go, just so
we can properly see how that shadow looks
at this up a bit. And their regards. So we can see that the shadows
look pretty darn good. And in the next video, when we will be
setting up our world, I'm going to actually be having predetermined values
that I'm going to apply. What I recommend is that
should do this yourself. Before I take you
to your challenge, we're going to go ahead and add the exponential heights to
remove this voids down here. So exponential heights simply
drag it into the world. And you'll notice
that now we have this little world
in front of us. We no longer have a void down there was with a
cool-looking Fog. Now what you can do is you can decrease the fog density a bit, but just keep it a little
bit higher than 0. And items like that. Much fog because it looks like we just dive
in, we're in heaven. So I'm going to add
a bit of zeros here. There we go. So 0, maybe
that's too little. I don't know. Just increase a little bit. There we go. I think
that is good enough. So as you can see now we have a beautiful world to work
and it's not perfect, but it gets the job done. So I'm going to take
you to your challenge. And your challenge
is to studying. We use the two links I
provide you with to check the various properties for
the Volumetric Clouds and for the building of
the fog effect there around with the options
if you're interested in creating and
tweaking your own sky. And finally, you can, if you don't find any link. So you can either search for
volumetric clouds and sky, atmosphere, and add to
it unreal lamentation. And you should find
everything that you need. So pause the video right now, go to the challenge and I'll see you in the upcoming section, most probably where we will
be building our first world. See you then.
22. Section 4 - CyberSpy 3027 - Building Our World - Lighting And Preparing Our Level: Welcome back my fellow
game developers to a brand new video. And in this one, we are going
to be setting up our world. We're going to create
everything from scratch. As you can see right here. This is our level, this is our clouds, our atmosphere,
our fog down here. And wherever we're going to set the lighting, set
the post-processing, set the clouds,
set everything up, so set yourself properly. And let's not waste
any more time, and let's get started. Okay, so now it's time to start creating our real-world
cyber spy 3027 game. So let us go ahead
and do just that. I'm going to go
into the games and noticed I've opened
up a new project. I'm going to select the project and make
sure that it's blank. We don't want to have
any other template will select the project name and
we'll call it cyber spy 3027. Let's see. We can not add a space or you can call your game
whatever you want. It depends on you. Let's keep everything the same. We'll keep stopped at
content, maybe we'll need it. Let's go ahead and Create. And I'll see you whenever the game has been or the
project has been setup. Okay, welcome back.
So as you can see, we start off with this nice
looking table and whatever. What I'm going to do is
I'm going to simply go in here and create a new
completely empty level. And this is going to
be our main level. Now, let's start off
with the basics. I have everything right
here next to me that I'm looking at all the values because I've already set up, set up this level. As we go on. Please feel free to
add whatever you want. Feel free to add any other tweak anything that
you've learned so far, I'm going to use the basic
thing that I've created. I'm not going to try to do anything very weird
because I don't want these kinds of videos to take me three or four hours. Let's get started. First of all, I'm going
to create a cube. It set the position
to 000 on all sides, make this scale one
hundred ten hundred by one hundred ten hundred. This is going to be
our main platform. Next, I'm going to add
a directional light. This is a directional
light and I'm going to enable atmosphere sunlight. So I think this is it. I'm going to enable the
gas shadows on the clouds. I'm going to enable the cast
shadow on the atmosphere. Next we're going to
add a sky atmosphere. So I'm going to add this right
here so we can find things faster and I'm going to
search for Sky, atmosphere. There we go, add
it to the level. We can reset the position. It doesn't really matter
where this guy is. Next, we're going
to add a skylight. So this is a skylight. I'm going to reset, reset its location
really doesn't matter where the location
of the skylight is. I'm going to add a
post-process volume. This is going to
be very helpful. It will allow us to better
adjust everything around us. Now, obviously, I'm also
you don't need to reset. It doesn't matter where this process volume
will be because we are going to turn on
infinite extension on it. So I'm going to make this
detail panel at a bit bigger. And I'm going to first of all, but let's go to infinite extent and set this to be unbound. This means that it's not only
inside of this cube that the post-process
volume has an action, it's all over, it
has infinite extent. Now that we've set this up, let's go into the auto exposure. And what does the
auto exposure mean? Well, if you, for
example, look at the sky, you'll notice that slowly it
starts to brighten up and then when you look
down, goes back down. So once you look at the sun, everything starts
shining brighter and whatever then you look down, it starts dreaming again. We don't want that to
happen because it will take a bit more processing time and it's really not worth it. So go to the minimum
and maximum, right? This turn them both on and
we'll set both of them to one. So the minimum is one, the maximum is one.
And there we go. You'll see that the whole
world is much brighter, but don't worry, we will
compensate for that. Next, we'll add some
atmospheric clouds. So volumetric atmospheric
clouds will add that. Next we'll add
exponential height. So exponential
heights, so we don't have this void anymore under us. There we go. Everything seems to
be looking good. Let's search for volumetric fog, and we'll add some
volumetric fog to the exponential height. This, if you notice
there's a tiny bit of difference at the end
there, but it's not. That showing will also change
the fog scattering colors. So 4k, 4k scattering color. We'll make it completely white. So there we go. So you can see how the
difference is there. Now we're going to go
into the skylight. So skylight, there we go. There are a couple
of things that we're going to change in here will make the light
color a bit more blue. So we'll set that to blue. We'll change the intensity
to be around 0.8, whereas the intensity, Let's see if we can find the
thing here, Intensity Scale. You'll notice here that
if we drag this down, How much does it affect things? It will most likely be more obvious when we
look at the shadow. If I add a cube in here, just see the cube. Yup, very obvious. There were all sorts of social. There we go, where
you can see that the cube has its shadow, a bit of a blue shade. We'll change that in just a bit. We'll at once we
adjust everything, everything should be
looking quite good and maybe the blue is
just a bit too much. So back in the skylight, I'm going to change this
to not be completely blue. Maybe just, just kind of
like that gives a more, a better looking view, will go to the
directional light. So directional light will
change the intensity. Let's just change it to 0.5. See how that looks. And let's go to the light shaft, turn that on and turn on
the light shaft bloom. And we'll set the bloom
scale to be 0.05. And finally, we are
going to change the color of the
directional light to be a bit more orangey. How do we change this to orange? Maybe like this. Okay, there we go and make it a bit more orangey,
and there we go. So I think that's everything
that we wanted to set up. Oh, okay. So I made a couple
of adjustments. Not too much just changed up the folk scattering on
the exponential heights. And I think all of
our level is set up. The last thing I wanted to do, let's close up the
place actor for now. I'm going to move on to the challenge and issue
a small challenge was the post-processing level change the view Jeanette vignette to maybe it's called
****** or vignette. Vignette, change it to ¢0.5, the global saturation to 1.3
to give it a bit of a hue. Then add anything extra you might want to have
in your level. And you can even experiment with the numbers I already gave you. So as you saw,
everything that I did right here was predetermined. That's why I made it so fast. But I do recommend that you
go through all of these, changed the angle of
the direction of light, play around with the fog. And if you feel that it's
too much of a hassle and you feel like your level
isn't coming up to well, not worry about just create a new level with the
starting content. You don't need to create
everything from scratch. This is just for me because I wanted to show you how we can create a level from
the ground up. And because I also wanted to do have our own
touch into the game. But if you want, if you
feel it's too much and you really don't care about it just stopped the
level of pressure. So pause the video right now
and go to the challenge. Hey, welcome back. So let's see where the
post-process is in here. So I'm going to select it and I'm going to go to the vignette. Search for vignette. Select the vignette. How much did I say we needed? 0.8? I think. There we go. Yeah, 0.8. So even though I knew 0.8 was the
thing I wanted, I'm going to take it
down to around 0.6. Even 0.50.5 seems to be good. And let's set the saturation. How much did I say I wanted
the global saturation. Okay, global saturation.
There we go. Click on that and let's
just set it to 1.5. There we go. So it will make the whole world a bit more blue, just like you saw. Okay, so it's 0.31.3
and there we go. So I think now our level is already now let's move on to the next video
where we will, we will be creating
our first levels. Sort of the design will just
create a couple of objects in the sky and
we'll set a couple of pillars around our level, and then we'll start
creating everything else. So I hope you
enjoyed this video. I hope it wasn't too confusing and I'll see you
in the next one.
23. Creating Your First Level: Welcome back, my fellow
game developers. As you can see, we have
started creating our levels. We've added a bit of
ambiance in here. There's something I forgot
to mention that I set all of the cubes
right here in files. So we have the platform shapes, we have the sky ambiance, and we also created our
platform right here. As you can see, it's
nothing too much. It's just like a couple
of platforms that we jumped from one to the next
to get to the end of the row, we also have this
little golden ramp, which I honestly pump
like the color off too much just to make sure that we can see that there is a ramp. Electron will be adding
materials and so on. That's not waste anymore time. This video is a bit long, but it all depends on you. It's just a bit
of a guide on how to set everything up and
have your first level. So let's not waste any more
time. And let's get started. Okay, so now it's time to
create our first level. We're going to first of all
create the ambience around. So we're going to add a
couple of cubes in the air, and we'll add also
a couple of pillars around the level to
set everything up. And finally, we'll create
a small structure in the middle where our player can help from one place or another. So whenever you are
creating your level, it's always very
important to create a game design template
for the level. Usually that's done with
very professional tools and you'll see how much I
put in effort into it. Very good. No, I was just getting
it's all about keeping it simple
and stupid just for the sake of having
the overall feel of how your canvas or
game design will look. So basically, this is me or you, and there will be a bit of a distance between
you and the door? Yes, this is a door. So your goal is to get from this position to this position. And the way you do that is by jumping from one of
these platforms. So this will be
elevated with this one. Both of these will be elevated
and if you jump across, you cannot jump from the
ground to this position. This is very important. So we'll have a couple
of these things. And when you get to the door and you will be
able to and the level, we also have the stairs. So in case you're jumping from one platform to the
next and you fall down, you have the chance
to go back up the stairs and then
boop, boop, boop. Go back through your thoughts. So let us get started
with that before we do. First of all, I want to set the ambience around
this whole thing. This really also depends on you. But what I wanted to
do is I wanted to add, for example, a couple
of spheres in here. So let me go to the Create, add a shape, add a cube. For example, make this cube. That's lock it down. Make this
cube a 100 by 100 by 100. And just put it in
the sky like this, and then add another
cube with a bit of rotation like this. For example. There we go, this
is another cube. Let's make it 200 by 200. And then we'll add another
cube, for example here, which will be 400 by 400 by 400, make a day but farther away. Then add a another cube. This cube will be
a massive cube, which will be a ten
hundred. Ten hundred. Okay, so let me just
move away a bit. And then we'll move that
Q bright like this, then add another cube
and in other queue. So basically you'll
get the drill. And after adding
all these cubes, we can change this, for
example, to a sphere. Once we have a sphere
here, for example, then we'll add another
sphere and another one and make this 11000 by 1000. And once you've added
enough shapes in the sky, you can add columns if you want. I recommend that you can go
from perspective to top. And then you can start
duplicating things around. So you can select all
of these, for example, and then move them right here
at a widow of a rotation like that to keep things
fresh so they don't click Duplicate and
then add another one. There we go. This is just off the
top of my head and they're regards song now
when we play the game, currently we are
this floating thing. Let me go back down to prospective stand here
and then we start the game and imagine you're walking around and
you look up and you see all these crazy
cubes and the sky. Then what I wanted to do that
you just slopes camera now. Then what you want to
do is, for example, I'm going to add
another cube in here. We add a cube will make
it 50 by 50 by 50. Actually, I think
50 is a lot or no. Let's keep it at 25. Maybe, maybe it's
better at 2525. And let this be. 100. So we'll add one of these, a huge pillar and distance. And then we'll duplicate
it four times. For example, this
position of a trend them. There we go. Now we
can select this form. Then we can duplicate them
again and again and so on. And then you can take
the same pillar. And instead of 25,
make it 15 by 15, and make this maybe 200. Then you will add some of
these skinny pillars around. So there we go at this one. But to the back and
duplicated, duplicated again. Move it like this. There we go. So now we have
more variety of pillars. So we add a couple
of pillars ear, and then we'll add a
couple of pillars here. This is just for example. And just keep placed
right here in the middle. Look, imagine you're
a spirit small person and you look up
and you see all of these weird structures floating in the sky and you see
those are huge pillars. This will give you a world
in lots of authenticity. It will feel as if you are part of something
bigger and you're displaying in this
little clip playground right here that will create. And finally, I'll just
make another type of pillar like this
one, for example, take this back here and
maybe make it 150 down. And this will be the most, the one that will populate
our world the most. Make ten by ten. So this will be
small, skinny ones. There we go. We add one of these
smaller pillars. And we can even change the height of each
one of these pillars. For example, like this, like that and whatever. If you want, you can
make some of them floating. I do recommend. If you want to
experiment with that, then you will have these smaller looking
pillars right here. Now if for example, you're laying the
level and you're jumping from one to the next, you'll look up and
you see all of these different kinds of shapes at the
distance and really, really adds a nice
atmosphere to your level. So I'm going to cut right here and use
the power of editing, the magic of editing. And then I will show you what kind of level
I'll come up with. See you in, just save it. Welcome back. So there we go. This is my level. I also change the
materials here. This one is basic wall. These one are basic
shape materials and the ground is the
asset platform material. I wanted to change materials
in the next video, but I thought let's
just do it right now. What the heck? There we go. This is my level. Look how many cubes I've added. Look how many pillars I have. And if you look from the top, this is how it looks. It looks fairly
nicely distributed. I tried my best it as
much as possible and I want to add too many things because too many things
will obviously start taking a toll on your
processing power, even though I think this
is already too much. But it's okay. I guess I tried to make a fair
distribution here. So you can see we have a couple of thick ones
just like this one, a couple of little less
thick ones like these, and a small tiny
ones like this one. So there we go. This is the level
that I've created. Now let's go ahead and create the actual platform where our player will be
jumping around. I'm going to zoom in here. Maybe try to slow down a bit and I'm going to go ahead and Corey, oh, and by the way, I saved
level and call the level 0. I created a folder right
ear for the level 0 and the folder for levels and the content with the
level 0 right here. Okay, so now I'm going to
go ahead and create a cube. I'm going to reset
its position 2000. I'm going to move
it up a bit and I'm going to scale it like this. I don't have a
predetermined amount of distance that I'll have, but I think I can pretty much
figure it out on my own. Some kind of platform. So this will be our
starting platform. There we go. This is where our player, we'll be starting off. This is where the player
will be walking around. And if you want a good idea as to make it
floating in the ear, that would be really cool. I'm going to take down just
make it touch the ground. Yeah, about yea big. Then I'm going to
duplicate this one. Going to rotate it
around the sky. And then of course
I'm going to take. This is the y-axis. Nope. Okay, there we go.
So I'm going to scale this one down properly. All of this is really tedious. I know. And if you think it's too much, then please be my guest. Just do it. Do whatever you
feel like you're doing. You don't need to follow
my exact exact steps. So there we go. Now we've made the both the
bag and from of our level. Then I'm going to know
what this is too high. Let me just make it
a bit more small. There we go. Up. Yeah. I guess something like that should
be good enough. I guess. Yeah, kind of like this. The player won't see
these little mistakes. So it's okay if you
keep them going to add one to the
other side as well. There we go. Then I'm going to duplicate
this again, download it. Now we're going to increase
the size like this, increase the size a bit, decrease the height up a
bit more of it to the left. There we go. Duplicate and set it
on the other side. So now as you can see, we have this kind of
platform and we will try to make sure that we can not jump from this position
to this position. Finally, we'll add a couple
of walls on the side. So let's just duplicate this. Kind of like that. And we'll move right
here to the middle. Increase the sides like this, move it down a bit. So yeah, I think that
looks good enough. Maybe make it a bit thinner. There we go. All of these
are pretty adjustable, so it depends on how you want
your level to look like, as long as the player cannot escape from your level and go wondering
around or if you want, you can make that,
but I don't think that's going to be
very productive. So there we go. Now we stand in here and
as you can see, we have, imagine if you were
a player and you're standing here and you need
to get to the other side. And you see all of these tall
buildings in the distance and these weird cubes
and wherever sky high, which is really nice. I guess this is all
that we needed to do. What? Of what else? No, actually, I think we still need
to make the ramp, so we'll make some kind of
little ramp right here. Duplicating this one. I'm making it smaller
on all sides. I'm going to add a stair. I'm just going to add
this kind of ramp. And the ramp is extremely huge. Just for the sake of having someplace for the player
to move up in case he falls down and
move it up like this. And there we go. Let me just adjust
it a little bit. We probably need to
change this material just for the sake of
seeing what is going on. Let's see what do we
have something yellow, gold on a wait, I think we have some
kind of yellow material. This one? No, that's not one that
I was looking for. Let's just make it out of
wood for now or whatnot. I don't like this. Let's search for material. Whereas the yellow there
was a very nice tint of yellow that I
used to like adding. That's not what I'm looking for. Maybe we'll create
our own later on. For now, let's
just add the gold. Put it right here to the side. This looks not nice at all. But this will just do
because we want to make sure that it touches
properly right here. Okay, so there we
go. Now we have this ramp of gold. That's it. That's it for now. Maybe you can add a couple
of shapes for the cube. For example, these will be
the cubes that we jump on. What make them
like five-by-five. There we go. One platform,
the second platform. Third platform. This one will be a
bit to the side. It would be a tad longer. There we go. Make it a bit hard for the player to jump
from one to the next. So we'll make this
a bit more distant. Then finally, you will add
another one right here, and finally a one right here. There we go. So now
we have our level. Now, obviously there are a
couple of problems in here. First of all, it's
barely visible which ones are the platforms
and which one is the ground, which is going to be very
hard for our player. The second thing is
that when we play, we are this orb that
can float around, which is not good at all. This is something
we will adjusting after we learn how to
create a character. Finally, we seem to have
something very blend because everything looks the
same and we don't have a door on an
or an objective. This is something we'll deal
with later on in the level. I hope you enjoyed
this video and I'll see you in the next one. Sorry, just before I leave, I wanted to issue the challenge. Your challenge is going to be to design your own general area. Design the shape you'd
like your area to have. You can use paint like me or
a more professional tool. Don't go too deep
into it as later we'll be introducing
other mechanics. This design might change. Build the level you want after watching me doing it a bit, doing it a bit, have
fun and go crazy. So design whatever you want, add whatever shapes you
want them to distance, add whatever type of
platforms you want. This is where I leave
you troop for now. See you in the next video.
24. Building The Inner Structure: Welcome back, my fellow
game developers. As you can see in this video, we've added a couple
of materials. We've created our own
materials like the yellow one and this red one and the green one you've
actually created yourself. So let's not waste
any more time. This is a long video
and let's get started. Okay, so in this video
we are going to be creating a couple of
materials to make sure we can distinguish
between the floor, the end, the platform, the platform we need to
eventually get to the walls. And maybe even we can change
up these outer balls a bit. Let's get started first
of all, with the floor. So I'm going to
click on the floor. So you can see that
the material on this cube is the
basic shape material, and the material on the walls
is also the basic shape. Let's choose this one and
maybe change it to the floor. There we go. So now
we have this floor. Let's select the
four walls right here and we'll make
them the basic wall. There we go. So now we
have a distinct color. This one we shall
change to the platform. Yeah, I think that's good. No, I don't think that's good. But it still adds a bit
of change in color. We can keep these
platforms as they are. Now, the next thing
I want to do is I want to change this color
right here, but this, I wanted to use some
kind of yellow or gold, but there is no yellow
or gold material. What shall I do in
this predicament? Should I give up or should I use a bit more skill in order
to create my own material? Well, that's exactly
what we're going to do. I'm going to go ahead into the content to remove
the material filter. Maybe let's go ahead and create a new folder for the materials. Open this one up, right-click in here and
warning before we start, I'm sorry, right-click
and create a material. Now a warning before we start, what you're about to see
will be a bit scary, especially if you are a total beginner and unreal and never seen
anything like this. Stay brave. I'm going
to name this VM, which means the material
underscore. Yellow. Hit Enter. And I'm going to
double-click in here. Okay, what is happening in here? I have no clue. Nobody does. This is basically we can
create our own in material. As you can see, we have a
ton of options in here, and we have a ton of
options in the details. And as I've told you, a material or texture is usually created by a whole
different department. When it comes to
game development. What I'm going to do is I'm
going to introduce you to the very basic things
that we can create. So let's go ahead
and first of all, create a very basic
yellow color. How are we going to do this? We're simply going to
right-click in here, search for a vector parameter. As you can see, we can also
add a lot of other stuff, but we'll add a
vector parameter. We'll call this
the yellow color. And it will simply going to
attach it to the base color. Double-click in here and
just search for a yellow, golden kind of look
in here and you can see immediately the
colors taking shape. We can determine how we
want that color to look, maybe a bit yellow or yellowish. I think this is good enough. Hit OK, Control S
to save everything. Then go back in here. Now we can see that we
have this yellow color. It will take a bit
of time to render. Now, if we drag on these
yellow color, there we go, we can see that we
have the yellow color ready to be
used on the platform. And I'm just going to move
this a teeny tiny bit. So it is perfectly
placed just for my, for the sake of my OCD. And if you don't have it,
congratulations, that's it. I think that's good enough.
We'll just stop it. And that yellow color
seems a bit goofy to me, but I guess it's okay. Now, it's time to go ahead
and create our door. Now, the way we're going
to create our door is, first of all, we're going to
right-click and the content. We're going to create
a new folder and call it the exit door. We're going to double-click
to open up the door. And in here we're going to
create a new blueprint class. Now, this is scary. Don't worry about it. Once we clicked on
the blueprint class, we are going to create an actor. This actor is going
to be called BP, which stands for blueprint
underscore exit. Door. I know all of
this is a bit advanced, but stay on course with me. Open up the blueprint. This will make so much sense later on as we
move through them, especially in the next section. Here we're going to
create our door. First of all, we'll
go right here to these three little dots
will create the shop floor. Then we're going to go
ahead and add a cylinder. Once we have a cylinder, we're going to call
this the outer frame. We're going to move
it down like this. Over backwards like this. Maybe we can rotate
it. I don't know. That's just reset the position. Now we're going to go ahead
and make it a lot bigger, except for on this side, we're going to shrink it down. And then we're going to make it about maybe three by three. So this will be the
outer view of our door, sort of kind of like this. Let's choose a material for it. I'm going to select the one that I like a lot if I can
find it. There we go. So this will be our
outer view of the door. Next we're going to add
a another cylinder. We're going to call
this the inner frame. Will rotate it like that. I'm going to obviously make sure that this one on the Z is one. Maybe even smaller. I don't know who knows and
move it up outwards a bit. Make this five. There we go, so it
sticks out a little bit. And then I'm going to
make it a bit bigger. So yeah, kind of like this. This. There we go. So now we have the outer door or inner
frame, excuse me. This really will depend on how you want your door to look. And this is the floor
in order for us to know where the player will
be stepping in if you want, maybe you can move this up a
little bit just like that. And if you want to change a
bit of a distance in here, you can detach the inner
frame from the outer frame. That way, you can really just have your way
in designing things. And the last thing
we want to do is we'll duplicate
this inner frame. So click on the inner frame, hit Control W. And notice
this as the components. And this will be the
in their door glow. This is where we will know
whether our door should be glowing green if it's open or grow glowing red if
it shouldn't be open. So I'm going to make
this kind of oval shape. This is where the
player will know where, whether or not he can
exit through the door. Let me just make
this a bit wider. Move it up like this. There we go. Now let's just change the material
on it just for now, just so we can see how it looks. And you'll notice that
all of this fluttering, this is because they are
on the exact same plane. Once we move it outside
a bit, there we go. There is no more flattering. So this is my door. It's kind of ugly. It's not the prettiest one, the prettiest door on the block, but it will do the
job, in my opinion, be compile, we save, and now we're going to
create a material of equal growing rent
in the exit door. I'm going to right-click. And before we do that, let me just go to the end of the level and drag our
beautiful door in here. And it turns out this
door is extremely small. So there we go. I think we misjudged how big this
level is going to be. Okay. I really
think we misjudged the size of this level any ways. Let's just keep
this door up here. Later on we'll be fixing
any problem that we face. We can just select
all of these and make them smaller and adjust
everything around us. Anyway, this is our
teeny-tiny door on the other side of the world. If you want, you can
make this bigger. So we can just
simply select all of these and just go like this. Yeah, not the optimal solution. Let's for now just
keep it as it is. Going to the exit door. Right-click in here and
we'll create a material. This is going to be
m under glow red. Hit Enter, open
up this material. We're going to right-click
and add a vector parameter. This is going to be the red, and we'll select
the red in here. There we go, Make it all red. We're going to set it
inside of the base color. This is the first step. Second step is we want to add a bit of speculations
or specular, makes it a bit more. How should I call it a
bit more reflective and gives out a bit more color
to the world around it. So the way we'll do this is
by simply clicking on one, holding down one and click on the canvas right
ear or the graph. So drag that to the specular. Let's see if that
makes any difference. There we go. We can see we
have a bit of difference. We can simply if we
want to hold down Control or hold down
Alt, remove that. You can see the teeny
tiny difference and that when we set it to red. And finally, we
are going to take this one Control W
to duplicate it. Set this right
here, value to ten. Now we're going to right-click
find the multiply. Drag from the base color and drag from this
value right here. And then we'll make it
a bit more emissive. So now you'll see after
a while, there we go. We have a red glowing color. So save, apply. Then go back into
the level door, select the door glove frame, and set this to be
the red material. If we can find it. There we go, the
red glow material, compile, save back in the level. There we go, you can see our door looks red now
this indicates that we cannot go to the
next level unless we do a couple of things in
order to make it green, but we don't have
any green color. So this is going to be your challenge to create
the green material. Create the green material
similar to the red one, meaning it needs to be emissive and have all the same values. If you want to add your
own material like bricks, feel free to add them to
any surface and the level. Also feel free to go to the
Epic Game Store and get yourself some real
cool free assets. It's in the marketplace, it's very easy to
find and that's it. Pause the video right now
and go do the challenge. Hey, welcome back. I hope you applied
your own material. Now as you saw, I felt that the level has two huge because the
doors very small. Let's see what we
can do if we go to the Create at the place
actors and I'm going to search for the player start
now this will give us roughly the size of the player that we are
going to be using. If I turn this guy
around 180 degrees. So this is basically how tall
we are going to look like. If you think it's good enough, then by all means use that
kind of level design. I like it. I think it's big enough. I think it's not too big. Maybe it's a little bit too big. But if you feel like
that, what you can do, Let's take this player start and move them over to the door. And there we go.
You can see that this door is kind of small. So what I'm going to do is I'm going to go back
to the exit door. I think I'm going to make it
just a little bit bigger, so increase the size, make it six, increasing on
the y to make it six also. Then we'll increase the
size of this egg-shaped, whatever. Maybe make it. Let's increase the
size right here. And honestly, you can
stop the video right now. This depends on how you
want your door to look. You know what, maybe just
make it David smaller. Yeah. Kind of like this
oval oval shaped door. Let's compile save Look. Let's see how that looks. Yes. Deliberate, small. I just wanted to door at
least would be this big. Let's see, compile save. Even though the bigger
wouldn't be to hurt too much. There we go. Now let's
increase the size of this bad boy. There we go. And now for the outer shape, which will be massive, compile save and the level. Yeah, I think
that's good enough. So now the door, if you look from the beginning
of the level, you will see that, yeah, that's kind of a door
at the end there and it's exactly what
we are looking for. Maybe move this door bit out the frame just a
couple of inches out. Ten, there we go. I think that is our door. And all of this can
be later on adjusted. I might adjust it outside of the videos right here
because it's like, honestly, the game is
what you want to make it. So if you want, you can go for this
kind of style where you have this touching right here. Maybe this will give
the door a bit more like a claw and feelings, some kind of I don't know what kind of design
you are going for. Some reason, door right
here isn't Excel because we need to move the entire
door to the bottom. Like that. Yeah. There we go. This is our futuristic
looking door. Yeah. That's why I keep telling you I'm
not the best designer, I keep that thing to people
that know what they're doing. So I hope you
enjoyed this video. I hope you did the challenge. I really hope that you
created your own door. That's not this ugly, and I'll see you
in the next video. Let's go ahead and create the green material and
it's pretty simple. All you have to
do is simply take this and duplicate it by
hitting the control w, or you can control C, control V to copy it. Then select right here, and instead of the glow red, colored glow green. There we go. And they now open
up the glow green. And all you have to do
is select the color in here and just move
it out to wrap. So remove any green and the red, any blue and keep
only the green head. Okay, now we have our
green Apply. Save. And now we should see they now. We should see that
now we take out the door that's duplicated
by holding down Alt. There we go. This is a second door and let's try to add
something to the frame. I don't think we'll
be all right here. There we go. And now we have
a green and a red door. I hope you enjoyed
this video and I'll see you in the next one.
25. Section 5 - Blueprint Visual Scripting - Blueprint 101: Welcome back my fellow
game developers and congratulations on making
it to the next section. I know the previous sections
is there have been mistakes, there have been false, there have been weird the
magic things happening in the editing because
sometimes I do make mistakes, but now I am in my element. This is what I love. I love programming. I love how to change behaviors. And as you can see
in this video, we are going to learn about the basic blueprints and we're going to start off by
creating our first nodes. And when we play the game, you can see that we are
printing to the screen. Finally, something exciting. I hate creating levels and
putting different colors. And whenever it's not my style, it's not where I thrive in. This is what I love. I
hope you feel the same. So let's not waste
any more time. This video is already long
enough and let's get started. Okay, so finally we are starting
to get to the fun part. This is where I like to be. This is my natural place to be. I thought like designing, not actually, I like designing. I don't like lighting
and atmosphere. I like programming. I like to make things
behave in a certain way. And that's exactly
what Blueprints do. The blueprint visual
scripting system In Unreal Engine is
a complete game. Please script things
system based on the concept of NADH
based interface that allows you to create gameplay elements within
the Unreal Engine, just like you saw in the
first game that you created, just like you saw in any
other place, we did anything. We can add behavior to certain actors whenever we
create a knowledge base. And this system is
extremely flexible and powerful as it provides
the ability to a designer, not a programmer, to use
virtually the full range of assets and tools that are
only available to a program. So before we start off, why would we even
need blueprints? So first of all, we can create customizable Prefabs with
construction scripts, just like you saw in the previous video when
we created a door. So now we can add multiple
doors and this is very helpful whenever you are creating something
other than at all. We can create a playable
game character. So currently, we are
just floating around. And sometimes you
might have solved the 3D person that's
walking around. We can actually create
one from scratch. We can create a chart that
shows us the barriers, how much health we have, what we picked up, what
weapon are we holding? And we also can create the
game rules and requirements. So it tells us we
need to pick up five jams before
the door opens up, or we've already picked
up two gems and wherever. So all of these are
possible was the blueprint. And we also have two
type of blueprints. We have the Blueprint class, which is ideal for making
interactive assets, such as doors, which
is collectibles, and the structural scenery, just like we saw in
the previous video where we created a door. And we also have something
called the Level Blueprint. So a level has its
own level blueprint. And this can reference and manipulate actors
within the level or keep track of data and change the behavior
based on the data. In order to access
the Level Blueprint, we can simply click right here
at the top on blueprints. And you will get the
option to either create a new empty
Blueprint class or you get the option to open up the level blueprint.
Once it's open. There we go. You can see that we have all of these weird windows that we saw previously but never
really gotten into. So let's talk about them. First of all, we have the graph editor right
here in the middle. And this panel is the heart
of the blueprint system. It is here that you will create
the networks, the nodes, the wires that pulled the fine
you're scripted behavior. Nodes can quickly be selected
by simply clicking on them and then just simply
dragging them around. And you can see that
these right now are disabled because
they are not used. If you're bothered, simply click on these or
you can actually delete them but less
than delete them because we'll be using
them in just a bit. Second of all, we have
the my blueprints panel. This is essentially an
outline which is right here. The panels here allow you
to view existing elements of the blueprint as well as
create ones on your own. And by the way, that's just drag this right here
until the panels. So now we have two untitled, something I forgot to mention. We are in the my first
game project will leave the cyber spy project alone
and do all of the learning. This my game project. I created a new level where its own atmosphere
and everything. So you don't have to
worry about that. Let's save this
inside of the level. And we'll call this VB, which stands for
blueprint testing. Maybe we'll need to
call something else. It's okay for now. And you'll notice that the name of the level
of Blueprint is the same exact one as the name of the level
that we're working in. So next, let's talk
about a couple of things which are the key concept
understand for blueprints. First of all, the variables. Variables are properties
that hold a value of all reference an object or
actor in the world, soap. If you look right here, you'll see that we have
variables and we can create these variables by simply clicking on
this plus button. I'm not going to go right now. And two variables
because we have a separate video for that. Next we have the functions. These are all the
graphs belonging to a particular blueprint that can be executed or called from another graph
within the blueprint, within the blueprint, this
is a very powerful tool. If for example, you
have a function right here that makes something
explodes and you want to make that
something explored from metal know a weapon
or a dinosaur. You can create a
function and call that explosion from
here on the dinosaur, which is very helpful. You can also create or
overwrite an existing function, will not worry about that. We'll talk about that later on. Now, we also have something
called the macros, and these are
essentially the same as collapsed the graphs or not. We're not gonna go
too deep into macros. They are but advanced and we really will not
be needing them. Just know that they
are collapsed. Combination of nodes and graphs. Then we have the Event
Graph which performs an action in response
to a gameplay event. So for example, if you have a character and it
bumps into a car, that's an event,
something happens. Then we have the
Event Dispatcher and active communication method, or one actor
dispatches and event. And another factor that is listening to the other
event is notified. So for example,
let's say we have an actor that has the enemy, he's a ball, goes flying
through the world. And then we have your character, which isn't, which
is also an actor. And once they bump
into each other, there is an event dispatcher
from the player or from the enemy bold to the player that tells
us something happened. And then we started
doing things. We'll see all of that in more
detail as we experiment. This is just for you
to have a journal, general knowledge of
what's happening. Next, we have the Details
panel right here. We've already talked
about the graph, the Blueprint Panel or gay, and now we have the details
panels or the Details panel is also where you will handle many blueprint editing tasks, including editing process
for blueprint variables, changing their name
pipes and all of that implementing
Blueprint Interfaces, adding inputs, outputs to
function, and adding events. So just a small example. Once we create a variable, you can see all of the
different things we can do. We create a function. There you go, you can see
we created a new tab. We can also change a lot of things above the
function right here, and all of the things are
right here on the details. So it's similar to
the Details panel and the levels are for
the various actors. But this is particular for certain elements inside of the graph that's just
delete this function. We don't need that and
leave this variable again. Now let's talk about the nodes
that we have in front of us will delve deeper into
nodes in the next video. But let's just see what
these are right now. Nodes basically our
objects such as events, function calls, flow
control operations, variables that can be
used in the graphs to the find the functionality of
that particular graph. You can see some when we begin, we have the event that it can play and the event tick system. And you can see how the event looks by the red
color that it has. The beginning is the event
that is triggered for all actors or every single actor has the event begin
plate some norms. But generally the ALU, when the game is started, this is triggered and any actor that has
spawned into a game after the game has
Boulder this thought that also calls the
event begin bleed. So for example, let's
say you're playing a multiplayer game and you respond to the map again,
there's a beginning plate. Event is dispatched. So let's go ahead
and test it out. Maybe I'm lying. So I'm going to print out a string and let's
slow it down a bit. I was at the pasty. Drag from this
element right here, release the left mouse button
and simply print a string, and this will print hello. Not only that, you'll see
this is a function or this was a event nor this
is a function node. When we open it up, we can see that we can either
change what is typed in here or we can change
the text color. And it also can change how
long a duration this for last, Let's set the duration to five. Set the color to
red, and compile. Whenever we do anything, we always need to make
sure that we compile, save, and then we can play, we can either start playing
from here, which will pray, play regular gameplay, or we can play from this button right
here, must we click it? The GOP. You can see that
we have the hallow on the top left corner. How cool is that? Now, next we have
the thick naught. This is simply the
offend that is called on every single
frame of gameplay. It has an output pin, which is the Delta. You can see it right here. And this is the amount of time in-between each
and single frame. Now it's time to understand
how the Delta Works. And it's going to be your
challenge so thick, thick. Not sure where I
call the challenge like that, but anyways, print out something using
the event thick this time, play the game, see how it looks. Now add a delay node
in-between them. The way you add the node
is you simply right-click and side of the graph and
then look for the delay. Right-click. Okay, Sorry, I forgot
what I said anyway, right-click search for
the delay and put it in-between the event
tick and the print. Make sure you do
the connections, set the delay to 1 second, increase the duration on the
print to be ten seconds. And remember to compile every
time you make a change. So pause the video right now. And gold worthy challenge. Hey, welcome back. So first of all, I'm going to right-click in here and write out print string. I'm going to connect it. And I'm going to say in here
that this is the print. And I'm going to keep it for ten seconds with a blue color. So, okay, Compile, Save, play the game and their regard. We can see that
every single frame we have the print, printing out. And if you don't
know how many frames we will have in per second, remember that you can
always show the FPS. Next we're going
to create a delay. So I'm going to move the snout, right-click in
here, right delay. And then I'm going to connect
these two nodes in here. I'm going to set the
duration to 1 second, compile, save, play the game. And now every
single second I get the print, print, print, print. So I hope you did the challenge. I hope you are always
now this spot, this is where the challenges
are most important. I recommend that whenever
you see a challenge, you always pause the
video and always, always do your best. Remember, I am always watching you and I
know what you do. I hope you enjoyed
and by this time, if you haven't already, please leave me a review. It helps me out a lot. Thank you so much for watching. See you in the next video.
26. Nodes: Welcome back, my fellow
game developers. In this video, we are
going to be learning everything there is
to know about nodes. We will learn about
how they look, why they look the way they look. Why do they have so many pins? How do these pins work together? And what are these
kinds of wires? So let's not waste any more
time and let's get started. Okay, so now time to talk about or to delve deeper
into the nodes that we have. The graphs that
are used inside of the blueprints can be
event and function calls to perform actions
and response to gate play offense associated
with that blueprint, we're talking
about, each type of node performs a unique function. However, the way
in which nodes are created are usually the same. How do we create notes? First of all, we can
right-click right here and on any empty space
in the Graph Editor tab. And this brings up a list of all the nodes that can
be added to the graph. Actor is selected in the world. It also gives us the option
for that selected Act. You can see it right here,
selected actors available. We also have context-sensitive, which is, as it says, contexts sensitive to a
specific special actor or something and our graph. So let me just demonstrate
how that looks. For example, if I add a
Cuban to the world and I keep selecting it back in
the level I right-click. You can see that I get, can get a reference
to that cube. And I also get a lot
of other things that are common or related
to that cube. The other way that
you've seen me do is we can simply drag a connection
from an empty pin. And then when we release, it also gives us the option to create some kind of note there. Next, we can also select nodes by clicking on them.
That's pretty obvious. But what might, you might have not known is that
we can hold down Control and then select multiple nodes and we can move
them around all together. And if we want to deselect
one of the nodes, we can simply hold
down the Control, select one of them, and now we simply move the
ones that have been selected. Next, let's talk about these weird little
pins that we have. Nodes can have pins
on either side. So we can see right here
we have these pins on the side and pins
on the other side. We'll see many other
types of these. Pins that are on the left
are called the input pins, and the ones on the right
are called output pins. Pretty simple. We have two types of pens. You'll notice we have
these white ones, which are the execution bins. Execution pins are used to
connect nodes together, as you can see right here, to create a kind of
flow of execution. When an input pin is activated, the node is executed. That means once the
spin activates, once it gets the flow from here, this node gets executed. And once the execution
of the node is complete, at activates an output
execution then, and then continue, continue, Continues, sorry, for flow of execution similar to
right here in the thick. We start off with a thick. We go to the delay once
the delay is done, and then goes through the
output execution been, and whatever is on the
other side, it executes. The execution pins are displayed as an outline, just like here, whenever they are not wired, and once they're wired
they become solid. One thing to understand about execution pins, that
sometimes functions, actually functions always have one input execution pin
and one output execution. But other types of nodes
can have multiple inputs and output execution pins are allowing for different behavior, but button on the
pen is activated. Second type of pen
that we have as the data pens that you
can see right here. And these data pins are
used for taking data into a node or outputting
data from a node that, that happens are type-specific, as you can see right here, one is a string. We'll talk about
the different types of variables that we have. But for now, keep
in mind the string, the Boolean, and all
of these things. And they can be where your two variables of the
same type which have a that have been on their
own or a that had been of the same type
from another note. For example, you can
see that this one is a float and I can only
attach to a float. I cannot attach to a color, even though in this case, if we hover over it, you
can see that we convert this flow to a linear
colors structure. That means we can attach it, but for example, we cannot
attach to a Boolean. There is no conversion in there. We can convert this float to a string and then
we can execute it. Like execution pins that have bins are displayed
as an outline. When they're wired.
They are not white, they are not displayed,
they are full. So you can see that once we
connect them, there we go. And you can see that
they also have arrows are on them that
determine the direction. What we'll talk about
that in just a bit. Let's just keep it
as it is right now. The other thing
that we can do with these data happens is that we can promote them
to a variable. Let's say for example, you want this text
color to be a variable, meaning that you
want to change it at some point manually,
dynamically, instead of coming right here
and changing it manually, what you can do
is you can create a variable right
here on the left, or you can right-click
on the text color and see that you can
promote to a variable. And this essentially
is a shortcut for manually adding a
variable, which is very nice. Now that we understand nodes, a bit better time to
talk about the wires. The wires are the connection
between the pins, which represent the flow of execution or the flow of data. Let's talk about the
execution wires, which are these white ones. These are the wires in-between
the execution pins, and they represent the
flow of execution. Execution wires are displayed
as white arrows spanning from the output execution
pen to the input execution. Then the direction of the arrow determines the
direction of the flow. Data wires connect one database to another database
of same type. Just like I said, they are displayed and
colored as the arrow and are used to visualize
the transport of data. So notice that the wire
right here is green, but if I connect it
to the text blue, you'll notice we created
this as a converter. You can see that now
because this one is a return value over
linear color structure, and this one is also, that means we have a blue line, solid lines color changes
depending on what the data is. Now, these connections can only be made between two
compatible database. For example, I cannot connect this output execution pin into one of these.
It's impossible. It even tells me that will
be with these being all faded out once I
release back to normal, if you drag a connection
when that is not compatible and error will be displayed also
on top of them. I don't know if
you've noticed that. Yeah, there we go. We can
see that it's an error. It cannot be done. And we can also remove any
connection that we've made. So let's say we don't want this Delta seconds to be
connected to the duration. I can right-click in here, and I can go to break
link and break the link. What I also can do if I had
this connection is I can hold down Alt and click on this and the execution
is destroyed. Now another thing I can
do is let us say this, that happen to connect
to this duration. So what I can do is
hold down Control, click on this, and now
I can move it around. This really does
save you a couple of seconds whenever
you get used to it. So what else do I
need to teach you? The last thing I would like
to add is, for example, let's say I want to
connect this data up into this data pin
and to this data, then what I can do is I
can double-click in here, and this creates a another node. And now I connect this
to the second one. So now the Delta seconds
data is flowing to the duration and it's
flowing to the print string. And it's also allows me to
add a bit more organization. If there ever is a node in the way and
things get complicated, this is very helpful just
to add a bit more contexts. It's very important to be well-organized whenever
you are creating nodes. Because if you ever come back to your node and you haven't
organized the dwell, you would be so lost
and you would have no freaking clue what's going on and how your
program is working. Trust me, your future self will always thank you for
being organized. Now, with all of
that information, let me show you a challenge
to disconnect and the quit. First of all, stop
the screen printing without deleting
the print nodes. Disconnect the beginning play and the thick from printing. And a new keyboard event
when the one key is pressed. And when pressed,
Add a quick game, a functional compile, and play. Pause the video right now
and go do the challenge. Okay, welcome back. So I'm going to hold down Alt disconnected delay and going to also disconnect
these two durations. And I'm simply going
to delete this. I'm also going to disconnect the beginning
layer by holding down Alt and clicking on the
execution, then compile. Now let's go ahead and add. This is glitching. Give it right-click in here, add a keyboard event, and I'll look for one event when the one key
is pressed or released. Once I click on that, I'll notice I have the pressed released and the key
that was pressed. From here, I was told that I
should create the quit game. Hit Enter, and now I should
have everything ready. So Compile, Save, play the game. Now we walk around, we have this weird the cube, we jump on top of it and when we click the one week
with the game. So I hope you
enjoyed this video. I hope you are having
as much fun as I am. You can see the way I'm
bugging super-fast. I hope I'm not being
too fast for you. And I'll see you
in the next door.
27. Blueprint Variables: Welcome back, my fellow
game developers. In this video, we
are taking things to the next level because right
now when we have a chair, when we press the one key, we no longer see things being printed or quitting the game, boring stuff that nobody likes. Now we make the chair right
next to us disappear, and we also can
make it reappear. So let's not waste any more
time and let's get started. Okay, so now it's time to
learn about variables. Variables, as we've
said previously, are properties that
hold a value or a reference of an object
or an actor in the world. These properties
can be accessible internally to the
blueprint containing them, or they can be made accessible externally so that
their values can be modified by a designer working with instances of the blueprints
placed in the levels. All of what I said du will be
clear once we get started. First of all, let's talk
about the various types of variables that we have. So once you create a variable, you'll notice that
you have the name of that variable and you also have the type of that variable. If we try to select
the five-year, see that we have a lot of them. Let's talk about the main ones. Booleans are values that can
be either true or false. Byte is a whole
number between 0255. Usually use the
for, I don't know, something that's very small, not too big to 55 at the max, we have a digit
numbers which are, I think between
minus 2 billion and something to 2 billion
and something. These are 12345, so these
are integer numbers. Next we have indeed your 64, which is the same as integers, but on a bigger scale, scale, you might be thinking,
why do we need a bite and integer
and an integer 64? Can't we just use the
integer which is irregular? Well, maybe you need a huge number or maybe you
need a very small number. Now you might be
asking me, well, why don't we only
use the integer 64? Well, because when you
create a variable, you take up a bit of space in your memory
on the computer. The less you use, the better performance
your game creates. If you know that the number you are creating will only be from 0 to a maximum of 255.
Then you use a byte. If you think that your
number is going to represent the iron or the number
of stars in the galaxy. Then you'll need the integer 64. Next we have the float. This represents
numbers with decimals. So for example, 0.050.5, anything that has a
float decimal in it, anything that has a dot, something is represented here. And just as integers, they can be negative
or positive. Next we have the
double is the same as the float, just a
little bit bigger. We have the name, which
is a piece of text used to identify
something in the game. We have a string, which is a string of
characters such as a, B, C, or the end wherever. And once these characters
are strength together, we have the string. So for example, right here you can see the print is a string, the hello as a string of
characters or numbers. Next we have text,
sorry for that. Next we have the text, the text that you
display to a user. This is very helpful in a sense that it's different than a
string because you can have, for example, different
languages on this. Next we have a vector. So we've learned what factors are these are three-dimensional. Usually they are used for three-dimensional coordinates
such as the x, y, and z. We have the rotator. It's a group of numbers that define the rotation
in a 3D space, we have the transform
that allows us to create 3D positions,
rotations and scales. And finally, we have all
of these other things. We're not talking
about all of them, but we'll say that we
can create object types. Also. For example, I create, I can create a variable
of type Static Mesh. There we go, we can create a variable of type Static Mesh. And you can see this right here. You can also make variables, not only a single pipe, you can make them arrays, Sets. And Matt, Don't worry
about this now, we'll only learn about arrays later on as we move on
through the course. Now, next, how do we
create these variables? Let's say I create a Boolean
variable right here. You can see that it is represented under
the value variables. In the My Blueprint panel, in the Detail panel, there are several properties
for this variable. First of all, we have the name, I can call this whatever
I want or for example, I can call this Michael. If I wanted to. I can add spaces to
width and I can do whatever I want the name to be. Next, I can set
the variable type. We've seen that already. We have the instance editable. This will determine
whether this variable is publicly editable to an
instance of the blueprint. Meaning, for example, remember
when we had the door, we don't have
anything currently. Remember when we had a door, let's say I wanted to
have this door animal. Let me see if we have
anything in here that we can use and the content. Now, all kids saw the launchpad. Excellent, We have
the Launchpad. Okay, so let's open
up the launchpad, even though this is
not a Level Blueprint. But the variables
work all the same. So for example, we
have this variable, we set it as instance editable. We save. Now I didn't compile
and then save. Now in the testing, when I add the Launchpad, you can see that I can
change this variable which is right here in the new
variable that I created. If it's not the
instance editable, compile save, then you
can see right here, I can no longer change that. Just a little preview
of how that works. Next we have the blueprint. We've only this is whether
this variable can be set by the blueprints
node or whether it can only be read and
not set on its own. Next, we have the tooltip, which is basically
the description. Next we have the
explores on spam. This should be the
variable that is exposed or the bin as exposed. As soon as we start the game, we have the option
to set it private, meaning we cannot use, use this variable or access it from a
different blueprint. This can be very helpful
because for example, you don't want to change out on all the players health when you jump on or when you shoot a gun, for example, I don't know. Some things are
best kept private. Next, we have the
exposed cinematics. This should variable
v exposed to a sequencer or a man
mathematic name? I'm not sure how it's exposed
and how it's pronounced, but you'll see later on
that if we, for example, have a sequence or if we
have some kind of timeline, some kind of animation should this variable will be
exposed to that animation. Next we have the category. So remember when we had a variable right here
on this Launchpad, if we open up the blueprint
for the launchpad, we have this variable and
it's a category of default. We can call it like
category high. Now if we compile
save, go back here, you'll see that it needs to
be instance editable file save back in here you can see that it's under
the category high. What else do we have? We have the replication. This is whether this game, this variable actually
this is more of a whenever you're playing a
multiplayer game and whether you want to, in this variable to be replicated
on all of the players, not just the server that's
handling everything. This is just a, something a bit more advanced. And finally, we have something that we don't see right now, but it is available when
we want to create it. And that is if we have,
for example, transport, notice that now we
have a new option in here which is short
through 3D widgets. This is only enabled
when we have the instance editable
on shore 3D Widget went true allows
the user to tweak the vector variable by using a 3D transport widget
in the viewport. This option is applied
to the effectors, the transforms,
and we'll see how that looks later on the course. Now, let's move
on and talk about the accessibility or how to access variables
and the blueprint. Let's say now we have
a Boolean variable. We have a three right
here, it's called Michael. How do we actually drag it and use it right here in the graph? Well, we can simply
drag it like that. So simply selected,
drag it into the world. And now you are prompted
to either get this, meaning we get the information or the data from this variable, it tells us what it is. Or for example, in the
case of a boolean, is a true or is it false? Or we can drag it and set this variable so we can
set whether it's true or it's false after
connecting it to one of the output pins on one
of the notes right here. Now, alternatively and
a bit of a shortcut is if you drag this Michael
and hold down control, and then you have the option
to immediately get it. Or if you drag it and
you hold down Alt, you have the option to
immediately set it. So keep that in mind. The control and the OLC
allow you to get and set. Finally, we have the
referencing of actors. This is something that
you've seen already. If you go into the
swirled, for example, and we've selected the
launchpad back in the testing. When we right-click in here, we can create a reference. And this is basically also a variable in our
world that we've got. And the last thing
is similar to or actually we've
already talked about this when we create a variable, if we right-click on any data that we want
to have a variable of. For example, if we want to get a variable for the duration, we right-click on it, we create a variable or
promote to variable. And there you go. You can see that a variable
is created of type float, which is the type of the data. And that was right here. If you right-click
and promote to variable from an
output, that happen, you can see that we go
to the set and not to the gate of that variable
with all of that information. I think it's time for a bit
of a challenge for you. And this challenge is
called the magic chair. Now, I created this challenge when I had a chair and my level. In order to mitigate
this problem, my my lack of concentration, I'm going to add a
chair to the level. Okay, so now we have
a chair in the level. Now that we do find for
the magic chair challenge, get a reference to the chair or any object in your level
and your level of VPU, BP, meaning a blueprint. Then add a set hidden
end game function node. Attach the chair reference
to the nodes target. Connect the node to
the tick events. So it updates all the
time and promote new hidden that had been dual
variable and call it is hidden. Finally, when one
expressed set is hidden to true and when released
set is hidden to false. So the video right now, but reread the
challenge if you're not sure what you should
do and go do. Harlan. All Kaye, welcome back. I really hope you
tried your best even though you'll notice right now that as we go
through the videos, the challenges are
going to get harder. So we've selected the chair. Let me go back and
do our testing. Right-click and we'll create
a reference for the chair. Next we're going to
right-click in here and we're going to set hidden game. There we go, we can
find the criteria, but there is a, okay, so something
happened right here. Let me just delete it and make sure that we understand
what's happening. So I right-click and you'll
see that I can set hidden. And you can see right
here that calls function on Static
Mesh actor three, which is the chair that
I have right here, which is the static ash
mesh actor three set. Alternatively, what I could have done is I could
have dragged from this thin and set hidden game, and this would have
created the same function. So actually this
set actor hidden, IT don't want that. We set hidden in game, set hidden and game, which is this one. And notice that this time
we create a reference to the Static Mesh
Component because we don't actually hide the chair. We hide the Static Mesh
Component of the chair. So now that we understand all of this
mind-boggling things, Let's move this side, will give them as a souvenir. Let's move this up right here. We're going to attach
to the event ****. We are going to promote
the new hidden to a variable and we'll call
this new variable is hidden. So if it is hidden, then we will hide this chair. And if it's not meaning
this one is false, we're going to short
the chair right here. I'm going to stop this. I'm going to drag it up in
here, detach it by month. And then I'm going to drag
these hidden to the pressed. You'll see it immediately
creates the set. And I'm also going to drag
this hidden on the release. And this also creates
the SAT for the head. Now, when we press is
hidden should be true, when released is hidden
should be false. Compile, compile, save. Play the game. There we go. So now we have this chair. If we press the one key,
the chair disappears. When we release them one
key, the chair reappears. I hope you enjoyed this video. I hope you liked what you saw. I hope you're enjoying
this new blueprint and behavior and manipulation and world manipulation
using this node. As you can see,
it's very simple. I know if you're
just starting out, it might be a bit confusing, but trust me, as you know the challenges which is
the most important part. And you slowly learn
how to do mistakes, how to correct these mistakes. You are going to
become a master to understand the little tweaking things that you need to do. Top, hope you enjoyed. See you on the next one.
28. The Blueprint Class: Welcome back, my fellow
game developers. In this video, we
are going to be learning about the other
types of Blueprint, which are the blueprint classes. So there are different than
the level blueprints and that they are attached
to certain classes. For example, this chair is not a irregular
Static Mesh actor, as we've come to understand, it, is a blueprint class. And when we come near it, it becomes a while. It displays something
to the screen as you can see whenever
we are near it. So let's not waste any more
time and let's get started. Okay, so now that we've seen Level Blueprints and to look
at the blueprints classes, there are several,
several different types of blueprints
that you can create. However, doing so, we'll
need to specify the type of the parent class in which
the blueprint will be based. Whenever we are creating
a blueprint class, we need to select
the parent class. And you'll hear
me say that a lot of times whenever we are working with several ones with
the parents and whatever. The two ways of creating or actually three ways of creating a blueprint is first of all, by opening, opening up
the content right here. And inside any folder you want, right-click The create
a blueprint class. You'll see that you will
be prompted to one of these blueprints and told
to pick a parent class. So if you have an actor, a bomb, a character, a player controller, a
game obeys, and others. You can see clearly actor is any object that is
placed in the world. A bomb is any act or
that can be possessed. A character is a
bomb that can walk. A player controller is an actor that is responsible for
controlling the poem. That can walk a
game mode base as the game mode where
we can, for example, set the number of genes
that we need to pick up, or how long until the door
opens and whatever and the other ones aren't as important and will not
be going down into them. But you'll notice that we have a lot of other parents
that we can create. We can basically create a
blueprint out of anything. But don't worry,
you won't need to understand all of them slowly, but surely you will be
experiencing most of them. So let's go ahead and talk
about the second way we can create this by clicking
on the ad right here and also creating
a blueprint class. And finally, we can convert any object in the world
into a blueprint class. For example, if I
add a Cuban here, okay, so we already had a cube. We use this cube. We
can go right here, right next to where
we add components. Click on these three little
dots connected with a wire. And you'll see that
this allows us to convert this object
into a blueprint. You can select the
name of this object. So B P underscore best cube. And we can select this
to be a band glass and the parent class will be
the Static Mesh actor. Once selected. There we go. Now we have this test, the cube as the band class with a static mesh actor already available for us to
play around with. And notice that it is the For some reason
this has blocked me. I think pretty much this
is because an error. I don't know what's
going on, but anyways, let's continue what you can open a blueprint either by let me close this and let me save
and close this one also. So you can open a blueprint by either clicking in here and
opening up the Blueprint. You'll notice this
is a bit different. Now don't worry, this is the simple version
of the blueprint. And if you want to
open the full one, you can simply click in here. And this opens up
the full blueprint for you to play around with. Notice that I think this is
not moving because this is the the root components or we cannot move
it. I don't know. I'm not sure if that is
the actual problem was. But anyways, the
other way we can open it by simply selecting
the actor right here, clicking on this and
opening up the blueprint. Next, let's talk about the
class or the blueprint to how everything is
exactly the same. You can see the My Blueprint, you can see the view
port right here. It's different than
the Level Blueprint because we can actually modify and add objects in here
and add the components. We can see the details panel. If we go right here
into the Add component, we can select what type of component we would like to add. So for example, we can
add a static mesh actor. We can add a queue. And it's exactly the
same as when we were adding actors in the Details
panel and the level editor. So it's exactly the same. So for example, when
I add a sphere, you will be immediately prompted to change
the name of it. So I'm going to
call it my sphere. And now I can move this
sphere around and notice that it is the child of the
root component up here. Now we can also remove a component obviously
by simply deleting it. It's that simple and that easy. Whenever you add a component
that's going to be in the center of
the rod component. But obviously you can
then change it up, rotate, and scale it, do whatever you want with it. And you can also create
advance and functions that are related to this component
that you've created. So in the Details
panel you will see all the various
things that you can change about this a sphere. You can also see them here
that you can actually create events on the
component begin overlap, or whenever an object passes by and starts
overlapping with the sphere, this component will
trigger and we click, for example, in here, you'll see that we create a node that is an event of the
overlap with the sphere. But there is another thing
that you can see right here, the same way that the Level Blueprint has
an advantage graph. This one also has an offender grab the blueprint class
also has an event graph. You can see it has the same
nodes which are the event, the event thick, and it
also has an additional one, which is the event
actor began overlap. Now this is a bit different than the
one that we see here. And it's not about the overlap. When we created
the overlap event, it was only for the sphere. By this one is whenever we are overlapping the act or meaning
if we overlap the sphere, or if we overlap the
freaking unbelievable Q, which is right here. And we also have the
construction script, which has only a single node
on it, which is purple. The construction
script runs following the components
list plan instance of a blueprint a
class is created. And why did I use
the word following? Because even though you might think is that
whenever you add an act or it's instantaneous and everything happens
at the same time. That is not the truth because something's loop before others. Even if there's a micro
millisecond difference, there is a difference. However, the actors starts
whenever it's created. First of all, we have the
components being created. Then we have the
construction script running, and then we have the
Event Graph running. This is how the actor or
a blueprint actor class created whenever we created into the world that
contains a knowledge graph. This one right here, that is executed following or allowing the blueprint class instance to perform installation
initialization operations. So this is very helpful
for initialization. We'll see how later on, and this can be
extremely powerful as actions like performing
traces into the world, setting meshes,
materials, and all of that good stuff is done in here. So enough talking,
time for some action. I'm going to compile. I'm going to save and I'm
going to close this test. What I don't know
who can see right here that when we
change the blueprint, it changes immediately
inside of the world. Now time for a bit
of a challenge. Now it's time to make
a parking magic chair. Take one of the
chairs in your level and convert to a blueprint. Add a box collider component and make it a bit bigger
than the chair. Call it a trigger called
the box collider Trigger. Select the trigger and scroll
down in the details to the bottom and add to
add Events category. Add an n-component, begin overlaps or press the
big green scary button. Then don't be scared of this. Simply print a string
from the trigger. That's all that you need to do. Compile, save, play, and
walk near the chair. And if you're feeling especially courageous in this video, try to use one over
the data pins and connect it to the string
that is being printed. See what you can get and see if you can figure out
what's happening. So pause the video right now
and go do the challenge. Okay, welcome back. So I'm going to
select this chair. I'm going to click on this to convert this to a blueprint. And I'm going to call this the BP underscore, magic chair. Anther. Select it. And now it opens up. As you can see in the blueprint, it's the root component
which is right here. Now I'm going to go ahead
and add a box collider. Box collision that's called, I'm going to call the trigger. That's move it up a
bit and make it a bit bigger than the chair. There we go. Now we're going to scroll down and select the
component begin overlap. As you can see, we get this event node and then we
have the various things. All that we need to do
is simply print out from here a certain string, which we'll see Hello, compile, save, play the game. Now, as you can see, we already saw a hello when we enter into the box collider, when we start, start
overlapping with it, we get the hello message again. Now, Well, so many errors. What's the problem in here? Okay, so I wanted to cut because I wanted to
read a bit what's happening. I wasn't sure how
long it will take me. But basically the problem
here is if you look at it, there's a lot, but
they are all the same. So we are trying to
access a non x is non trying to read property
Static Mesh active three. And wherever you can
see under it we have access non Blueprint
B, B testing, execute whatever BP testing the event of graphs at the top, if we click on the Set hidden, it will take us to where
it is, which is here. So it was trying to access the static
mesh actor and good. But of what? This is an unknown. Why is it an unknown? Well, because now this is no longer the chair that
we were using to hide. Now it's called the BP
underscore Madam Chair. So we were basically
trying to hide something that is not available
to us anymore. This is very important
whenever you have an error to check if you've done something wrong back and the B in the BP testing,
simply remove this. I'm going to delete this and I'm going to disconnect
the set hidden, put this under a year, and put it right here as a
souvenir compiled saved. Now we should never
get any error. Now, let's see what happens. First of all, let's see we
have the overlapped component. If we attach it right here, Compile, Save, and now you'll understand why
printing so important. So I'm going to move the chair a bit further
from the player, so it doesn't start immediately. Now when we get close
to the chill your C, It's the BP underscore. Magic chair sees that 0, C under 0 triggered. So basically the
overlapped component is the trigger that
we have in here. Well, notice it says
the trigger at the end. It's from the BB chair
and it's the trigger that's being overlap at first. So if we try to change this
from triggered to Michael, that's usually does
everything using my name, use your own name. So now when we ever loved, you'll see that the
name is now Michael. Now let's try
something different. The other actor. So if we attach, so hold down control, attach the other actor, compile, save more of this back a bit and you can start hearing
my voice is getting tired. Play that. And now when we go through, it's the third-person character, which is the one that
we're playing right now. Or that control select
the other component. This will give us
the other component that overlaps the chair. So the component only
third-person character as the collision cylinder. You might be thinking, well, what's the collision cylinder? I've never seen that
if we play the game, just hit F8, this will effectively
keep the game playing, but you will have the
option to move around. If you click on the
third-person character. How should I show you this and open up the blueprint right here and go to the event port and click
on this collision. You will see that it has eight Capsule Component
Collision back in here. If we had the FAA
again, there we go. It's the collision cylinder. How cool is that? So I hope you enjoyed this long video and I'll
see you in the next one.
29. Functions: Welcome back, my fellow
game developers. In this video, we are
going to be learning all about functions and
a very long video, but it is a very important one. I want you to put on
your thinking caps. I want you to embrace the power of
mathematics because we are going to be using
them to calculate the distance between two points, such as this, a and B. When we play the game, the F8 key, you'll notice
we have two 3D widgets, and if we add a bit of
distance in between them, you can see that it is
calculated on the fly. So let's not waste any more
time and let's get started. Okay, so now it's time to
learn about functions. Functions are now two
graphs and belonging to a particular blueprint that can be executed or called from another graph
was a blueprint. Functions have a
single entry point and a single exit points
similar to the hidden. And you'll notice that these are functions whenever you see
this little f right here, and the color is blue. So sometimes it can
be a different color, but it should always
have this f symbol. What are the advantages
of having functions? They can be reusable, they can be editable. They are very reliable and
they are easily readable. And you'll see how functions can really enhance our experience
when working with nodes, especially when we
have a lot of them. So how do we create
these functions? First of all, we have
the way or the method that we can do right here simply by clicking this
little plus icon, we have effective, effectively
created a function. And now we are
prompted to call it. We can call it whatever we want. Let's just call it my
new function for now. And then in the graph, you can right-click here and you can simply
call out the function. And there you go. You can call this
function, and there we go. So now this is my new function
which you can attach. And whatever. You have nodes in here, all the nodes that you create an ad and play around with R then all executed once inside of this little
knob right here. There are a couple of things
that we need to talk about, especially in the
details right here. And one of the most important
is the axis specify. When creating functions, you
have the ability to specify what other objects can or
cannot access those functions. This is done by setting the
access specifier property. And as you can see, we
have three of them. The public is a
setting for public, meaning that any other object
can call this function. This is the default
setting usually. Then we have the protected, a setting of protected
means that the function can only be called by the
current blueprint as well as any
blueprint that the arrives from the
current blueprint. And finally, the
private means that only this blueprint can
call this function. Now you might be a bit confused on what protected means and what does it mean to have a blueprint derived from another blueprint? The simplest way I can
put it is by showing you, for example, we
have this BP chair. Remember when we go and
create a new blueprint class, we should select the parent. Well, we can actually create a class that is derived
from the let me show you the VP underscore
chair, magic chair. I mean, as you can see, we can create this new blueprint that is the ride from the chair. And we can also do
that with everything. So when we create an
actor class blueprint, we are deriving from the act. So any function inside
of the magic chair that is protected can be used inside
a function that we could, I mean, sorry, a
blueprint that we create you that is
derived the chair, if it's protected, if it's
public, anybody can use it. If it's private, even a function derived from the chair
cannot access it. Now, back in the functions
we have this option to set it to either
pure or not pure. The main difference is that
pure function promise not to modify the state of the members
of the class in any way, while impure functions
are free to modify, the state, will
see that later on. Once we use pure function, we will come across a lot
of them, pure and impure. Finally, we have the inputs
and outputs parameter. We can set the input
and output parameter right here in the Details
tab of your function. To add an input, simply click on this plus
button right here, and you will be prompted to a new variable and you will see a new data appearing right here. You can name your valuable, for example, the new entry. There we go. So you can
choose what type it is. You can set it to have a
default value and a pass by reference. There we go. You can also do that
with the output. So look, when we
create an output, we have a return null. And if we go back into
the event of graph, you'll notice that this also has a return value and
an entry value. Whenever you are working
with this function, you need to give it
some kind of input. And then at the end it will
give you some kind of output. And you can also, for example, change this from pure. You can make it, or you can make it pure, meaning that it will
not modify anything, as you can see, it no longer has anything to attach to it. I'm going to delete this, I'm going to delete this. And now we are actually
going to have some kind of application for our function. Let's talk about the
Pythagorean theorem. I don't know if you've
ever heard of it, but it's a way for us to calculate the distance
between in two points. So whenever we have a
point a and point B, and we have some
kind of distance, especially when it's in 3D. It's kind of hard to
calculate if you've ever learned how to do it into
the, it's pretty simple. 3d whenever we have
them on an axis. And keep in mind the
a is the origin, but that does not mean
that it is zeros, zeros 0. It has an x, a y, and the z also the D
has an x2, y2 and a z. What we do is we get the distances like
this and we calculate the distance of x1 minus
x2 for the distance of x. Then the d y for the Y1 minus Y2 and
always to the power two. And finally the, these head
or uneasy or wherever you to call it the Z1 minus
Z2 at the power two. And finally, when we have
these three and this should have been the
easy, sorry for that. When we have all of these, then we can get the square
root of dx plus dy plus dizzy, and then square
root, all of these. So keep this formula in front of you is very
important if you want to take a picture of
it to understand it better keep in mind
this one is easy, sorry for the mistake. Now it's going to be
time for your challenge. Your challenge is to measure
for this, first of all, create a new BP actor called
it the BP underscore, beta gore or Igor. I don't know how
you pronounce it in your language or in your place
from where we were from. Then you will need to create a new function called
the Pythagorean Theorem. You will need to give
it to vector inputs, the point a and point B
and one float output, which is going to
be the distance. Use the break note on both
vectors to get the x and y and the z salt simply drag from the point a and use the break. You'll see what happens. Then use the subtract node. So create a minus this is
to get the DX, DY, DZ. Use the to the power two node on the result to add
them up in the plus, do a square root
to find the node, you'll need to
find that node and attach it to the output. Drag the function into the graph and make
sure it's not pure. Finally, attach it to the
event thick and print out the distance and make dual
variables for the points. Make them instance,
instance editable, and make sure 3D Widget enabled. So I know this is
a huge task ahead. I would love. I would put this challenge
difficulty at all, maybe eight out of ten. So don't worry, take your time, go through it, read carefully. I tried to do my best to
have everything broken down and do your best even if
you make a lot of mistakes, I'm going to go over
this step-by-step, but you need to
make sure that you also put in a bit of
effort into this. Pause the video right now
and go to the challenge. Okay, welcome back. So I'm going to close this down. I'm going to
right-click in here. And we'll create a
new blueprint class. And it's going to
be of type Actor. That's okay. We'll call it the BP underscore, beta gored by the
god. I don't know. Let's see what beat that gourd. Then create a new function,
the Pythagorean theorem. So we'll open this up. We're going to create a
new function in here, which is going to be the beta. Theorem. Hit enter. Okay, great. Next, we are told to give
it to vector inputs, which is going to
be the point a and point D. And one float output. I'm going to add two
inputs and one output. And by the way, and every single version of
Unreal that I've worked with, I always had a small
x right here in order to delete this variable
or this input. Or if you ever want
to delete those, you can see that we can simply
click on the X right here. The first one is going
to be called point. It's going to be of type factor. The second one is point B, and it's of type vector. The last one is the distance. And it's astype. Float. There we go. So now we have the Pythagorean theorem and it's not pure and everything
should be good. Next, what do we have? We need to use the break mode on both vectors to get
the x, y, and z. Excellent. So I will drag from the beat and type in break. There we go. We
broke the vector, we got the x, y, and z. And we'll do the same right
here to break the vector. So now we have two
broken down the vectors. Now, the next thing
to do is to use the subtract node and the
minus to get the DX, DY, DZ. Remember from the
Pythagorean theorem, we need to remove the x of the b from the x and
the y or vice versa. It doesn't really
matter because we are, we are making it
to the power two. So I'm going to add a minus in here for this abstract on the x. Duplicate that will do
the same for the y. Duplicate that. And by the way, I'm
duplicating using the Control W and finally the z. So now we have the DX, DY and the Zant. Seems good. Let me just okay. This looks really nice. Next we are going to
use the to the power two nodes and then add
them up in the plus node. So pretty simple
to the power two, whereas the to the power
square root of two. So square root, excellent. Let's duplicate this two times. One in here, one in here, and then just set
them up like this. Finally, we need to add them up. So AD Connect this one and
add a small pin right ear. I hope this wasn't too bad. There we got, so now we've
added all of them up. The last thing we need to do, after adding do a square
root to find oral, find the node to
attach to the output. So now we have to make
this a bit longer. Let's try to find
this a square root, which is the SQRT. Attach it right here and now we have the distance calculated. How cool is that? So it's pretty simple. We did the break, we subtracted
and got the DX and DY. We took them to the power two. We added all of them up and
we had the square root. Excellent. Next, Drag the function into the graph and make
sure it's not pure. In the event the graph, I'm going to drag in the
Pythagorean theorem. We are going to attach it to the event thick and
print out the distance. So down here in the Event thick, That's print out a string, which is going to
be the distance. So I'm going to attach the distance to the
string right here. Now we are going to convert it. We convert this
float to a string, and now we can show
it or print it out. And finally, make two
variables from the point and make them instance editable
and show the 3D widgets. I'm going to
right-click on point a and promote it to a variable. Right-click on point B and
promoted to a variable. So now we have the
point a and point B. I'm going to select both of
these and make sure that they are instance editable,
short 3D Widget. Point B, instance
editable show 3D Widget, and there we go,
That's the challenge. So I really hope that
you did your best. I know it was harder
than expected, but it was pretty doable if you ask me because all the steps have
been properly given. I hope anyways, compile, save back in the game. Let's just add to
the viewport may be a cubed, a cubed store. We can see when we add the
Pythagorean blueprints. So now we have this
pedagogy blueprint, and you'll notice that we have these two shapes right here
on top of each other if you, It's not clear, but
once you move them up, there we go we have the
point b and we have the 0.8. So now we have these two points. When we play the game, we should see that there is a distance that is being shown. I'm going to press F8 and I'm going to select the point a, the point a, and then
I'm going to move it. And there we go. You can see how all of this is changing in
front of our eyes. How cool is that? And this is the power
of using functions. So back in the Event Graph, instead of having all
of these right here. So imagine we have this
function In the event of graph. And then after it we want to do another thing and another
thing and then another thing, surely, slowly but surely, you'll notice that short
graph is filled up with so many images
and all of this can be avoided by simply using the simple trick of
creating a function. I hope you enjoyed this video. I hope the challenge
wasn't too hard for you, and I'll see you
in the next one.
30. Flow Control (Switches): Welcome back, my fellow
game developers. In this video, we
are going to be learning about flow
control and how we can divert the flow of
execution using special notes. So if you haven't already, please leave me a review. If you think I deserve
a five-star review, we'll just leave me
five-star review. If not, contact me and
tell me what the **** the problem is and I'll try to fix it and try to
improve my teaching. So thank you so
much for watching. Let's not waste any more
time. Let's get started. Okay, so now it's time to
talk about flow control. At the beginning,
I wanted to create one huge video to cover all
of these different nodes. But as I practiced this video at one down to be like 22
minutes or more even. So, I decided to break it
down into three parts. So what are the
floor control nodes? Nodes, these are nodes
that allow for controlling the flow of execution
based on conditions. So we're going to open
up the Level Blueprint and we are going to start
learning about all of these. Now, if you would like, I would like you to just
set a It's right here. Oh, my God, what happened? Just set a space right here because we are going to be doing all of these using either the Begin Play
or the event thick. And then after finishing, we'll just set them
on a separate wall, will make it the trophy
wall similar to this one, just if you ever need a
reference to any of those. So the first thing
is the switch node. I'm going to search for switch
if I can type it properly. And you'll notice that we
have a lot of switches here. We're going to
select switch on n. We can switch. There we go. Switch on and saw a
switch node reads in a data input and based on
the value of that input, sends the execution flow out of the matching or
the optional default. So what do I mean
by all of that? As you can see, we have this input execution node and one default output
execution node. When working in the
integer or a string. Or actually you can
create a switch on almost anything that
you would like. You'll see that later on. But for now, let's just
focus on the two main ones, which are the int and the string switch node is
added to the blueprint. And the only execution plan available is the
default pen right here. This will fire if
the input fields to match any of the other
specified outputs. So how does this work? Let's first of all
focus on the end. We've selected the end, we've added it to the graph. Now we can see that in the
details property we have the starting index at 0 and it has the use
of the default pen. If we turn that off, it no longer uses
the default pen. I'm going to go ahead and add in here three or four values. And then I'm going to attach
it to the event thick. Attach this switch
to the event tick. And then I'm going to right-click in here
and promote this to a variable which I'm going
to call the number one. Once I have number one, I'm going to get the
right-click to in here. Whenever I press the
two are actually, you know what, that's
called this number two. I think it's more fitting. Goal number two. And now I'm going
to set the number to be two when expressed. And then I'm going
to set it to maybe. Let's set it to 0, okay, let's keep it at 0. Now I'm going to print
out from here a string. This will be 0. Actually, let's just change
a bit of it in here. We'll just make the
duration a bit longer, so like ten seconds. Let's make it
thread. Okay, great. So now we have this one
and now we'll duplicate this three times at that **** to each one
of those outputs. We can properly see
how all of this works. 31 more time just for the default and will
write in here one here, two, in here three. The last one, we'll
set it to default. Now we have this number
variable attached, and based on the number two
that is going to be given, one of these will
activate if it is the 0, the 0 will activate if
it's the one-to-one, if it's the duty to if it's
the three is the three. And if none of these
options right here, it will just output the default. Then I created this
input right here, which gives us once
the tool is pressed, the number two becomes
two or a set as two. Once it's released,
it's back to 0. So Compile, Save, play the
game before I play the game. But let's just delete the
Pythagorean, whatever. Now when we play the
game, it's all zeros. But once I press the two, you'll see that now we
have two on the site, which is very cool. Now, what would happen if we, instead of the tool,
just set it to 12? Now when we compile, save, play the game, it's all
zeros when pressed the two, we get the default. How cool is that? This is the exact
same consequence. Every we are working
with a switch string. So I'm going to detach this and I'm going to
move this up here. I'm going to get the string. And I'm going to do exactly
the same thing if you want, you can test this
out on your own. I do recommend that you do it. I'll promote this to a variable. Write down the name
of the string, name and the string. You need to add the elements right here so you
can add the pins, but still you need to determine what is the string that's
going to be output. You'll get right
here in the details, the option to choose. I'm going to write in
here today. Tomorrow. Yes. There we go. So three options
and the default, I'm going to duplicate only
three of those anyways, let's not it's okay. Just delete this one. And maybe we should move
this a little bit down. There we go. Now we're
going to attach this today. Moral yesterday. And the default,
this is going to print out, this is this. Tomorrow. This. There we go. Now we are printing out
all of these three and all that we need to do is
to get these three key. Whenever it is pressed, the string will become
one of these two options. So the thing you need to understand here is
whenever we are working with string references, it's always important
to make sure that we have the exact same wor word. So I'm going to simply
copy yesterday. And whenever we press the
three it's yesterday, and whenever we release
the three, it is tomorrow. So compile, save what's
happening in here again, exactly the same,
nothing too special. When we press the three, the string name
becomes yesterday. When we release the three, the string name
becomes tomorrow. And the string name variable is attached to the selection
on the string switch. And based on whatever
the string name is, one of these options
is selected. So Compile, Save, play the game. There we go.
Everything is default. Why is default? When we press the three, this is yesterday, we remove
it, this is tomorrow. So obviously at the beginning, why is this happening? You might be asking, well, remember that whenever we create a string
name, there you go. You can see that by default
it's value is nothing. It's completely
empty. So instead, if we set it as tomorrow
as the default value compile safe now we should
see that this is tomorrow. So I hope you understood
what the problem was here, and I hope I didn't
say it too fast. I'm excited about all of this. So when we created the variable, its default value was 0, that didn't happen
d here because the actual value which is
right here was the zeros. So that's why this
didn't happen. I'm glad that we encountered this problem in order to better understand
what was going on. So the next node for flow
control and look also, I will teach you
something very cool. Which is if we add
these together in order to know what
this was doing, simply create a selection around all of them
and hit the C key. This will create a comment
around your notes, and we'll call this
the switch. On. There we go. And now
we can put it in the Hall of Fame or whatever
we want to call it. So I'm going to detach
this one right here, close these down a bit, select all of these, and this will be the
switch on string. There we go. There we go. Okay, so the next
thing we're going to learn is the branch. So right-click in here,
search for branch. And as you can see, this is similar to the switch, but this time it only takes
in a true and a false value, and it's only based
on a Boolean. The branch node serves as
a simple way to create a decision based flow from a single true or
false condition. Once executed, the
branch node looks at the incoming value of the attached Boolean
and outputs and execution balls based on the incoming or the
appropriate output. So if the condition
here is true, this option will be while the execution flow and we'll
go through the true. If it's false, the
execution follow. We'll go through the false. Now, I can create
some kind of example, but instead I'm going
to let you discover this on your own
using a challenge. First of all, make
the chair hiding work again by reattaching
it to the Atlantic. I hope you didn't destroy it. Use the hidden condition on a branch node when it's
true, print out hidden. When it's false, print out easily seen or
whatever you want, salt before I leave
you to the challenge, let me just incase you
deleted your set hidden. There you go, you can
see it right here, the center then on the
static mash makes sure to attach your little
chair in here, or you can use any other
object that you want. And then we have this
using the plus one. So pause the video right now
and go do the challenge. Okay, welcome back. How did you get on with that? So I'm going to drag
these two back in here. I'm going to set the branch, set this like this. I'm going to try to
zoom in because I know sometimes these aren't
well displayed, especially if you have
your quality normal. Especially if you have
your quality down. I'm going to compile, save, and the problem is okay, so we don't have anything
attached to the aesthetic mash. I'm going to select the chair. And from here I'm going to
get a reference to the chair. There we go, The magic chair, attach it right here, and now we have access
Compile Save, That's great. We have this hidden variable. So what I'm going to
do is I'm going to attach it to this condition at the branch after we set
this component to be hidden. And then if it's true, I'm going to print
out a string which is and make it last for
maybe five seconds. Then another one. If it's false. Compile, save, run the game. There we go. It seen at, seen at
seeing once we're inside, it gets one unseen. But once we click the
one key, there we go. It's hidden when we remove it. Seen once it's clicked, it's how cool is that. I hope you did the challenge. I hope it wasn't too hard even though it was
something new. So in the next video we'll be
delving deeper into those, all of those flow
control things. So I'll see you in the next one.
31. Flow Control (Branches) : Welcome back, My favorite
game developers. In this video we are adding
more items to Hall of Fame, the new and the new ones, the flip-flop, the for loop
and the for loop with break. I know this video is a bit
too long maybe for you, but that's because I'm trying
to make sure that I explain everything and not leave
anything too ambiguous photo. So let's not waste anymore time. And let's get started to case. Let's continue on from
where we left off. This isn't the second part. So I'm simply going to hit Alt and click on
this to detach it. Select all of these, hit the C key and
call this the branch. And we're going to add it to
our Hall of Fame up here, or the, what you want to
call it back in here. The next thing we're going to
learn is the Duchenne new, and you'll notice that it's here under Utilities flow control, the new node will fire off an execution balls n times n being this
number right here. After the limit
has been reached, it will seize all outgoing
execution until eight. Both balls is sent
back to the reset. That's shortlist. Show how this works. From the exit, we are going
to print out a string, which is going to be
the ethic counter. That's a good idea. So this will display the number. It will be in red. And it's going to
last class about. Let's put a second so
we can see properly, have time to review everything. And now we should compile, save, and play the game. And we didn't see anything. Excellent Because we've
said the N to be 0, I'm going to set it to five. Now when we compile, save, play the
game, There we go, 12345, but then it stops. Nothing happens. Why is that? Well, because it
will not display anything and this will not work anymore until we reset it. We're going to do, we're going to add a small
delay in here, which is going to
be a two seconds. Seconds. Drag this from the reset. And as you can see,
this is extremely ugly. So I'm going to double-click
on the wire right here. And I'm simply going to add
this kind of attachment. So look how much more beautiful and much
more understandable. This is why I always
recommend that you organize your notes, compile, save, play the game. 12345, we wait two seconds. 1212, bam, there we go. And you can increase this
to five to six to ten. As you can see, it resets
every couple of seconds. Select this, hit the C key, detach it from the event thick, and we add it to
the Hall of Fame. Next we're going to
talk about the new one. So do once. So the dual want snowed, as the name suggests, will fire off an execution
false just once. From that point
forward it will seize all outgoing execution
just like the do. Well, actually this can
be equivalent to the new n. If the new n hat equals one. This is more used than the
Duchenne from experience, I've always use the ones. Rarely do I use the new. Demonstrate how this looks. Simply attach this. We're going to print out a string which is
going to be hello. It will last us for, I don't know, Let's
put five seconds. Let's keep it blue. You can check in here if
it is starting as closed, this will not work until they
start closed has been set. So if you check it, it will not work until the
reset pin has been activated. So Compile, Save, and notice that we are in the event
**** in the benthic, we are printing out many, many, many times, every single frame. But in this case, we don't even print once
because we started off closed. Why do I keep making
those mistake? Now we play. There we go. We see the Hello. Now let's say we have
started with a close. We are then going to add a
delay of two seconds again. Then we reattach to the reset, double-click on the
wires, make it prettier. There we go, compile, save. And now when we play after two seconds, we
should see the hello. One. Bam, nothing happened. Why did nothing happen? So the reason
nothing happened is that this delay
doesn't even start. So what we're going to
do is we're going to, instead of using
the delay in here, we're going to get
the event begin play. Create a delay from here. Then we're going to attach it to the reset and then it's going to be resetting every two seconds. For now, let's just remove this. I'm going to hit
the ALT right here. Excuse me. Let's just hit the ALT ear. Okay, So what we need
to delete those. What happens now? The problem was
is that the delay didn't even get
executed because the du once never opened the
Print String never happened and the
delay never happened. What we did instead is
from the ligand play, do a delay of two seconds, recently, do once and now we will have
everything working. Compile, Save,
play, one, do that. There we go. It
worked this time. I'm going to remove this. And then I'm going to reattach
the delay at the end. Should've probably
displayed the problem before making or
fixing the wires, would have saved a bit of
time, but that's okay. So close the start,
compile save. Now we play the game. Hello. Hello. Hello. Okay, great, so let's select all of
these commented out. The blue. Once. There we go, That ****. And you know the drill by now, simply add it right here. Next we have the flip flop. Flip flop. There we go. So this
is the flip-flop, Flip-flop node and
execution output toggles between the two execution, sorry, did I say, I'll put an execution input and toggles between two execution outputs. The first time it's
called the a as output. The second time it's the B, then the a, then the
than the, than the beat. Node also has a Boolean
input allowing you to track when output
a has been called. So let's see how all
of that work works. We'll attach it to
the event thick. And actually before we
attach it to a ventricular, just a bit of a delay to see the process
happening slowly. We don't want to see
all of them very fast. We'll add a zero-point, will add 1 second this time because we want to
see them quickly. From the a, we're going
to print out a string, which is going to say point a. Or actually you know what, let's call it the hello. Keep it as hello. Make it less than seconds. And we'll duplicate
this and we'll call the second one from
the bee world. This should be printing out hello world one after the other. And then we're going to
duplicate the sprint again. This will go after
both of these strings. It's going to print
out the boolean a. There we go. You can see the conversion
happening right here. And just double-click to make
things a bit more distinct. What's happening in here, in the Event thick, we
get a delay of 1 second. Then we go to a which
prints out Hello from B. It prints out world. And from both of these we are going to print out a string, which is going to tell
us either true or false. If it's true, then it's the a. If it's false, then it's the B. And we'll set this
in red just in case so we can see
everything properly. Compile, save. And now when we play 1 second
hello, true world faults. Hello, true, world, false. That means that whenever
we have a hello, that means we have the a, that means we have a true. Whenever we have the
b, it means the world means that as a is not a speed. Okay, great. So select all of these
at the CQI flip flop. And I'm doing all of this very
fast because first of all, we don't want to waste a lot of time and
honestly, I don't know. I feel that they are
pretty self-explanatory. If you still feel that you
don't really understand, just try things out on yourself, see how everything works. I just really hope that
I'm trying to explain as much as I possibly can without
wasting too much time. Next, the for-loop. For loop. The for each, the for loop. There we go. The for-loop node works like a
standard code loop. If you've ever created a
for-loop in golf and execution balls for each index between
the start and the end, index and the loop
iteration will take place between frame, between frames. So large loops may incur a
huge performance hit song. We don't need to use
the event thick. We can demonstrate this
on the begin play, which is actually much better. So I'm going to start
this from 0 on Filter. And then the loop body is
simply going to print a string. And that string is going to
be the index. There we go. Just make it, give
it a bit of space. Set this to be 1212 is good. Suppose this down and then
we are going to print out a string after we have
completed the loop. That will tell us neat door. I don't know why. Compile, save, play the game. There we go, 012 until
the fan and finito. And notice how fast it was. It wasn't like the do
n which took its time. It was immediate, it
was instantaneous. So that's the difference
between it and the do. And if you are wondering, the other difference is that it doesn't need to start from 0. It can start from index
three, sort compile, save, play the game
3456 until then. And then we have the finito. That's basically the for-loop. Nothing too exciting about this. Select all of these C
for loops and enter alt, click on this one, and add it to our Hall of Fame. We'll
set it to right here. The whole thing is
getting crowded. And finally we have the
for-loop with breaks or for loop with break. This time you are going to
understand it all by yourself. So use the for loop will break at a for-loop
with a break, I've already done that for you. Print out the index
in every iteration, said the first index 0
and the last one can be done when the index
gets over five years, the branch to break FOR loop and also print out when we
complete the for-loop. And did you notice anything
before we continue on? Just wanted to show
you what I meant by when the index
gets over five. So you can use, for example in here, a bigger than or
greater than or equal. You can use this
to compare it to any other number that you want. So I'm going to delete this. I'm going to show you
the challenge again. So pause the video right now
and go do the Shalon case. We are going to attach
this to the beginning 30, sorry, because in the event thick this will blow up your PC. Then we're going to, what are we going to do? We're going to be printing
out every single iteration, a string, which is going
to be the index obviously. And then we're going to
also get from the index. And we're going to check
if it's greater than five. Once it becomes
greater than five, we're going to create a branch. From this branch, we are
going to check if it's true. We're going to break out. I want to break free. Similar to Eddie mercury. We're going to break free from
the clutches of the loop. Once we've completed, we
are going to also print out a string which is going to
tell us that we're done. We'll keep this for 12. This one also for 12, and we'll just add a red color for a bit of a distinction. What's going to happen in here? We're going to start off
from 0 until we get to ten. We're going to print out
every single iteration and we're going to check
if it gets over five, then we are going to
break out from the loop. Let's see how that looks. Combine, save, play the
game 01 and those six, because six is greater
than five, if we have, if we would have put in
here greater than or equal. So let's try that. Greater than or equal to five. This video is getting very
long, sorry for that. Then it is going to
stop not on the 6th, but on the five. So notice the difference, boom on the five and
then we're done. And what's the thing that
you need to notice is that we get the Don
actually printed out. That means the loop
has been completed. I hope you enjoyed this video. I'm sorry for the long sessions. I'm trying to explain as
much as I possibly can. Make sure to put
this in the Hall of Fame and I'll see you next one.
32. Flow Control (Gates) : Welcome back, My favorite
game developers. In this video, we're
going to learn about the last part and
the floor control. I can't speak anymore soap. We're going to learn
about the gate, the multi gate, the sequence
and the while loop, which is the wildest of all the non nods in
the unreal universe. So let's not waste
any more time, and let's get started. K, congratulations on making it to the last part
of the flow control. First of all, we're going
to talk about the gates or if I right-click in
here and type AND gate, you can see that I get
this really nifty gates or a gait belt is used as a way to open and close a
stream of execution. Simply put the nth or input
the x in an execution plan. And the current
state of the gate, whether it's open or closed, determines whether
those pulses bass out of the exit or output or not. So the toggle, which
is this last year, this execution been reverses the current state of the game. So opened becomes
closed and vice versa. Let's go ahead and
test this out. From the event
thick we are going to enter and from
the exempt we are going to simply print
out something which is going to be the hello
string in here. Then we're going to add
some kind of number, which is maybe the five. Let's do something
different, the space bar. So once the spacebar
is pressed, we open. Once the spacebar is
released, we close. We're not going to
test the toggle, I think split pretty
self-explanatory. So we'll compile, save, play the game, hit the space. There we go, we get a hello, we stop hitting the space. There we go. We start
with hit the space. We open up the gate. When we release the
space NOR gate opening, select all of these
at the control gate. And to the Hall of Fame. I worked for too long. I get crazy. Anyways, let's talk about
the multi-bit gates, all the Maltese gate
multiplied gate nodes, thicks and a single
data impulse and routes it to any number of
potential output. This can be sequential
or it can be at random, and it may also be lobbied salt. Let's see how all of that works. We have 0 is the
output 0, output one. And let's add another tool
which aren't going to be a print string. Hello, Let's make it
last for how much? Let's make it last
for ten seconds. Okay? Now I'm going to duplicate
this four times. It's going to say Hello, World. How are you? Or something like that. So actually let's start
to say, hey, there. How are you? There we go. So now we compile save and
will not add anything in here. We'll just play. There we go. Hey,
there, how are you? Now we can set it to be random. So when it's random,
compile save, we'll see that we get you there. How are okay, so it doesn't, it's not necessarily
like the reverse. If we play it again, you'll
see we have something different every single
time, almost. I hope. There we go. This is the third one.
How are you there? Okay, now, let's go
ahead and test out this. We're going to use the
just choose the hidden. So we'll use the is hidden
to loop, compile save. And the is hidden is with
the two button, I think. Yeah, there we go
with the one key. Sorry. I'll compile save. And now when we hit the one key, I'm just going to
remove the random. When we had the one key, this should be a
little beaks or play. There we go. So when we hit the one key, we get it again and again and
again and again and again. Excellent. There is also some, you'll notice also
that the loop is similar to the multi gate. But there's the loop is
similar to the reset, but there is a small difference. If I keep holding the one, you'll notice it will
keep on printing. But if I have something in
the reset, for example, when the spacebar
is pressed space, I was actually looking for the space bar and I
pressed Space stuff. That's how sometimes I get lost. Anyways, the spacebar, when
pressed, it will reset. So we play the game. There we go. When we press
the space we recent. But if we keep holding
down the space, you'll notice that we don't
have this looping accident. So let's put these all together and we'll call them
the mall thigh. This is basically the Bill Gates because it's small tollgate. The ways. Let's talk about the sequence. Before I go. Completely nuts that sequence. There we go. Let's zoom in. Allows for a single
execution plus a trigger. To trigger a series of events in order solve the node may
have any number of outputs, all of which gets, gets cold as soon as the
sequence node receives an input. They will always get called an order but without any delay. So for a typical users
such as me and you, the outputs will likely
appear to have been triggered Simon simultaneously and will not need to attach
it to the deck, will simply attach it
to the big in-plane. I'm going to add all of these, and I'm just going to copy
the one from Bill Gates. Copy these, and
hit the Control W. And we'll just use the hey, how are you? How are you? Hey there. Sorry for that. Hi there. How are you? We got all of these
are properly attached, I hope so when we compile, compile, save, labor
game, there we go. Hey there, How are you? Excellent, That's all
that we needed to do. Sequence this one is very
important to keep in mind. We are going to be using it. Some of these are not
as useful as others, but it's good to know
what you can use. Whenever you are
faced with a problem, maybe you'll remember
that this might have some kind of
flow control north. Let's go back into our whatever you want to
call this, the Hall of Fame. And let's see if I have
any tool that I can use. So it's good to know the
tools that you have, but not all of them
are that important? I would say that the branch, the switch and the sequence and the new ones are the
most important though. So I would call these four
are the most important. Now, time for the while loop and this is what I call one of the scariest and most
hard to control node in unreal because
it can crash or PC, you cannot add a delay in it. And it's very, very, I call this the wild, wild west of the unreal. A while loop is a
test condition and a body are all that
make up the while loop. So for executing, executing
statement in this body, the blueprint evaluates the while loops test
condition to determine if it's true after executing this statement and it's
BOD is a blueprint, re-evaluates the test condition. If the condition remains true, it keeps on executing
the loop body. Otherwise, if the condition
returns to false, the blueprint determines
that the loop has finished and it exits. So keep in mind what
happens in here. Let's say we set whatever
we want from the loop body. Once it's completed, it
prints out completed. But how does it know when
to start and when to stop? Well, based on this condition, so let's say if the
condition is true, then it will keep on
looping through the body until or while the
condition is true, it will keep on looping
through the body. Once it becomes false,
it stops looping. While it's true, it
keeps on looping. And y is the while-loop
source scary? Well, because you can end up in an infinite loop and
that's the scary part. And the for-loop
or the fall break, you always have the
index that is eventually finished or whenever you
break out of the for loop. But in the case of the while, you can end up in
an endless loop and this can really
crash your unreal. It happens to me all the time. That's why I'm going to issue
it to you as a challenge to crash your PC. Not worry. If you follow the
steps, you won't be. You want to crash
anything from begin play, create a while loop. Create an integer variable, big number that while
is less than ten, keeps the while-loop going. And the loop we want to
increment the big number and then set it and
print it out every time. And finally, when
looping is completed, print out the done to the screen and I'll
give you a small hint. The nodes that are needed, the less than and the increment, increments as a plus, plus. Pause the video right now and
go do a huge welcome back. I hope you didn't crash any computer and I hope
you tried your best sort. Let's get started. I'm afraid I might crash
through this challenge. Anyways. Keep in mind we
cannot use a delay. I'm going to create a
new variable in here, which is going to be big number. This big number is going
to be an integer and that integer will have a
default value of 0. I'm going to get
this integer or by holding down Control and
setting it to right here. And I'm going to check if it is less than what did we say. Anyways, I think
then is good enough, whatever it was added
to the condition. Now every time we loop, I'm going to increment
the integer. And the integer I'm
looking to increment will be the big number
which is right here. We can use it since
it's a reference, it won't do us any harm. Let's double-click in here
and make things a bit more. I don't like whenever wires are going through other nodes, that really brings
up my old city. Let's see, maybe if
we delete it and we attach it without
I don't think so. Okay. There we go. It's better than using
that extra wire. Now after we increment, we are going to set
the big number. There we go. All I did was dragged
as big number and the execution which
immediately created a set. And after we set, we are going to
print out a string. And that string is going to be the big number that we just got. So after we print
out the big number, we're also going to print out
whenever we are complete, print out the string which
is going to be done. Let's make it red just so
we can distinguish between the numbers being
printed, compile, save. So what's happening in here? The beginning, we started
the while loop and we check if this
is less than ten, the big number which we got
since it starts off at 0, then it's less than, than, than the condition here is true. Then we open up the while
loop, the start looping. And on every iteration
we're going to increment the big number
that we have in here by one. So you can notice that it adds
one to the specific value. So plus, plus means
it only adds one. After adding one, we are
going to set the big number. Because remember here we're
just getting a reference. Here we are setting
the big number. So this number is increasing. After it increases, then we print out the
string that we got, so we keep track
of the big number. And once the big
number and this, like every single
loop iteration, we are checking the condition. So first of all, we start off with
0 less than ten, do it at increments by
one, it becomes one. Is one less than ten? Yes, continue 234 until we get to tan is stainless
than ten, know it's equal. Then we stop. So we shouldn't
see a fan or not. We should see a ten in here, and that should be
the last of it. Hit Play. There we go, 123
until we get to ten, and then it's gone. Play again, 0123 to ten, and now it has gone. So I hope you enjoyed the last
part of our floor control. I know it's been a long journey. I know you probably feel exhausted because of
their videos have been a bit long and maybe exhausted because they
have been also a bit hard. But trust me, this is a very important part of learning and understanding
how loops work. And also you're getting a lot of practice and node creation
and the blueprint, which is very important because they can
be really tricky, especially in the beginning. Added to the Hall of Fame, look how many
things you've done. Be proud of yourself, boss for a second at yourself on the back if
you've made it this far and go and leave me
a review because that's me on the back. There you go. I hope you enjoy it and I'll
see you in the next video.
33. Timelines: Welcome back, my fellow
game developers. In this video, we are going to be learning everything about timelines and how they can
affect the world around us, and how we can use them
to create animations. If we walk inside the light, you'll see that the light turns on to read and then
slowly it shifts, are actually very
fastly shift to green. And when we walk out of
our imaginary window, you can see it shifts
to green to red, and then it goes back down. So let's not waste
any more time, sorry for the long video, but timelines need some
time to understand. See you just a bit. Okay, So finally you've made it to the last
video of the section. Congratulations, you are one of the very few people that make it this far
less than waste anymore time because this is a very long
video and let's get started. First of all, the timeline, what our timelines, timelines are nodes or actually
they are special modes. Well then the
blueprint that provide time-based animation to be quickly designed and blade
back based on advance floats, vectors, or colors
that can be triggered at certain key frames
along the timeline. The best way to understand what the time timeline does
is by creating one. I'm going to go into
the Content Browser, going to right-click in here, create a new blueprint
class based on the actor. And I'm going to call it the BP underscore, light light actor. Open it up and now
let's get started. So the first thing
I'm going to do is simply add a collision
box in here. There we go and
add a light actor. And we'll choose it on
the default team roots. So it's not a child
of the box collider. And we'll call the spotlight. Spotlight or you know what? Let's make it a point
light. The point light. Let's move it up like this, not too far from the ground and let's make the box a bit bigger. So similar to this? Yeah. Maybe that's good enough, maybe make it just a
little bit bigger. Okay, there we go, compile, save, and now let's go
to the Event Graph. Now in the graph we're
going to add a timeline. Right-click in here, and we're going to simply
type in timeline. And you can see right here
we have the Add Timeline. Click on this, and now we have the option
for the timeline. We can call it whatever you, we can call it whatever we want. But in this case we
are going to make it the light changer. We'll call it light changer. And what we want to do in
this timeline is to make the light go down and then
go up using the timeline. Timelines can be edited
directly inside of the blueprint editor by
double-clicking on the timeline. And now you can
see we are inside. But before we do that, let's talk about the various
spins that we have in here. First of all, we have the play. This causes the timeline to play forward from its current time. Because the play
from start causes the timeline to play
forward from the beginning. Stop, freezes the playback
at the time of the timeline, at the current time, and reverse glaze it from
the end to the beginning. Then, sorry, from
wherever we are stopping to the beginning
and then the reverse from n, please the time backwards
starting from the end. Something new time allows
you to set the current time to the value in the
new time input, which is right here,
which is this new time, takes in a float value
representing the time in seconds to which the timeline
can jump when the new, when the set new time
input is called. Then we have the update which outputs and
execution signal. As soon as the timeline
is called Finished, obviously, it outputs and execution signal
when playback n. And just keep in mind
that this is not triggered when we
stop the function, when we use these top input. And finally, the direction
inputs or outputs, an enum data indicating the
direction of the timeline. Blank. Before we continue on, let's go ahead and
create a variable first. And this is going to be called
the brightness multiplier. Brightness multiplier. And it's going to be a float. We're going to compile, save, and we're going to set
it to be at around 2020, I think is a good number
compile that strike this N, right, in exclusive BP testing. Back in the light changer, which is right here on the tab. Or you can simply
double-click on the timeline. As you can see, we have
lots of options in here. So let's talk about each as
every single one of them. First of all, we
have this Add Float, which adds a new flow tract to the timeline for animating
scalar float values. We have the add
vector, which adds, adds a new vector truck to
the timeline for animating float actors values such as
rotation and translation. We have the add event track. This adds an adventure
which provides another execution
output pin that will be triggered at certain key frames that
you're going to add. You'll see what key
frames are in just a bit. Next we have the colored track, which does what it does. Let's use for animating colors. Keep this one in mind. Next we have the
select curve asset, and this is an external curve that you can add to
the timeline if you, for example, have one curve for several objects that
you'd like to animate. This is where you would add your external, external curve. And this is not the highlighted
because you need to be selecting a curve right here and the content,
the browser. And if you are, then you go back here. We can go ahead
and add this one. Next we have the
length which allows you to set the playbacks length. So how long this
animation will be? We have the US keyframe. If this is not active, the last key frame of
a sequence is ignored. This can be helpful
when preventing skipping when an
animation is looping, if you have an
animation that you want to keep looping playing the last key-frame
can create a bit of a skip and create
inconsistencies. This allows you to avoid these. Next, you have the auto-play
and the other plate. If active, the timeline does not require an execution
input to begin. It will start immediately. When we begin the level. Then we have the replicated. This is used whenever we have, sorry, I'll start on the loop. The loop. I think it's pretty
self-explanatory when there are the loop, this animation
loops, unless it's, it's interrupted
by the stop pin. And finally, we
have the replicate, which is usually used
whenever you want to use it across
multiple clients. Clients, meaning when you're playing in multiplier
and finally, ignore the time violation. I really don't know what
that thus yet the honestly, but I think it's
something that's pretty advanced and I've never
used it to be honest. Anyway, let's continue on and learn how we can add tracks. Timelines, use Trax, define the animation of a
single piece of data. This can be a float value vector or color or events
or one of these four ITU tax can be
added to the timeline by simply clicking on
the Add Flow track. So let's go ahead and do that. If we click on it, you can
see that we immediately add a track and we're
prompted to enter a name. So I'm going to call
this the brightness. Once added, you'll notice that if we go back to
the event, the graph, we have an output pin or output data that tells us the
brightness and where we are. Now it's time to start
adding some keys in here. You'll notice we have
the name and we have the ability to add
an external curve, just like we have on this one, but this will be specific to this brightness, to this track. And we also have, oh, there you go. You can see that we
can, for example, add the fog brightness, which is something
already available in the starters package. And also we have the
synchronized view, which will synchronize
multiple tracks if added on top of each other. So let's talk about adding keys. Once you have a trach in place, then it's time to
start adding the keys. And you can do that either
by right-clicking and add a key to actually know, right-click and add
a key right here. Or you can simply hold
down the Shift button, press the right mouse button. There we go. The
left mouse button. So the left mouse button. Now, how do we edit the keys? We can select the key
and move it around. Or to have more precision, we can simply change
it from here. We can set this to 0
and then maybe to some. Now if you, for
example, lose your key, but she can do is simply
click somewhere and use the Zoom To Fit Horizontal
and Zoom To Fit Vertical. And now it will fit your
whole timeline properly. That's if you lose
your key anywhere. Next we have the moving keys. Pretty easy, pretty simple. Finally, we have the
key interpolation. So I'll show you what
that looks like. First of all, we'll
add this key. Let's add two more keys. So hold down Shift and press
the left mouse button, select the first
key, set it to 00. The second key is going
to be on for 5 thousand, and the third key is
going to be at 80. There we go. So now
click somewhere around for XOM horizontal, vertical. Notice that, that
there is a problem and that is the length is five, while my animation
ends at eight. So what we should do
is we should actually change the length in
here to be eight. There we go. I choose the value
of 5 thousand. Well, because if we go back and do in the viewport and click on the point light will notice that the intensity is 5 thousand. So what do we want to
do is have it at 0. And once the player
enters this box, then the timeline will
start going from 0, which is the
brightness right now. It goes from 0 to 5 thousand
and then back to 0. And this should be all given to us through this brightness. So let's do that. First of all, from
the brightness, I'm going to go
ahead and multiply this by the brightness
multiplier. There we go. This way we get more intensity so we can clearly see
what's happening. And then from here I'm going
to add the point light. So drag the point line holding down control to get
a reference to it. And we are going
to set in density. Move it up in here at
that **** to the update. That way it's always
updating and attach this value right here to the
new intensity that we have. And finally, how are we
going to trigger this, that we just delete those three right here because
currently we don't need them. I'm going to get the
box and I'm going to scroll down until I
find on begin overlap, so on begin overlap. At this right here. When we begin overlap, we are going to start playing. And I also want to start reversing it once
we end the overlap. So on the box, when
we end the overlap, I'm going to start playing
everything in reverse. There we go. So compile, save, and let's see how all of this works and
actually know what. Let's not just play, let's play from the start. I don't know. Let's just play compile, save back in our game. And let's just move the
chair a bit to the outside. Or actually let's make this
platform a bit bigger. So two by two. There we go. So now we
have place for everything. And let's drag in
the, where is it? The light actor? And then we're going to play. So now if we walk right
here, there we go, you can see that the
brightness goes up and it should start coming down. There we go. So now the
brightness comes down. So when we leave again, it starts playing and
reverse and then go down. Now one more thing
I forgot to say, which is the interpolation. You'll notice how it goes up in a sharp way or linearly
and then it goes down. What we can do is right-click
on one of the key frames. And instead of linear, select Automatic, you'll notice now that the fall off
is very different. We can do the same on
the other GIZ and we can also adjust how that
is going to look. So now when we
adjust this compile, save, transitions
should be much smaller. So we're going to lay in here. And now we go to there
we go. It turns on. And while we're still
standing in there, if we go out on the end overlap, it will continue on the process. We stand inside, it goes right, and now it should
slowly start to say, again, when we go out, it will do the same. Why? Because in the Event Graph
we are playing the reverse. So I hope you enjoyed. Now before I leave you, it's time for a
bit of a challenge for you to test out your skills. So I'll change the light color, add a new color track that will control the color of light. Set the colors you want for
the light to change from N to make sure that there will be a shift
between the three colors. So when the middle
should be a bit of time, you'll notice now when
you add three colors, There'll be like a very fast
switch between the colors. Make sure that you
add more time. The middle for the
color that you want. And back in the event graph from the same point light
variable node, add a new node to set light color from where we
changed the intensity. Now you can simply drag from
it and set the light color. And finally, set
the new light color from the color change
and the timeline, the video right now
and go do the shallow. Okay, soo, let's go to the
light change a timeline. I'm going to add a
new color track. We'll call this the light, or let's just call
this the color. Scroll down in here and you'll see that
it's a bit different. So I'm going to
double-click in here, or actually let's
select the color. So it's pretty intuitive. And drag this one
similar to that. This one is for the opacity. If you'll notice the opacity, then we'll add another
color in here, which is going to be green. There we go. You'll notice they
blend the color blend. So what I'm going
to do is I'm going to Control C Control V pump. That's not gonna work. I'm going to add
another color in here, which is going to be red. There'll be goals. So now we have read and
change this to white. There we go. So we start off
white, we go red. And then we go back
to greenish yellow. There we go. And now finally
we will go back to red. And let's add a
bit of red in here and a bit of green in here. So now we have several
shifting colors. There we go. Okay, seems good enough for me. So we're going to go
ahead and save this. And let's play and
see how that looks. So I approached the light, it starts off white. It should begin to turn red. And it doesn't. Why did it not happen? Because I forgot the
most crucial step of actually adding that color. Anyways, Set light color, believe it or not, this
was not the trick. I actually forgot to do it. For some, I just
thought by some kind of weird magic without adding
anything, this will work. You'll see here set the color, simply attach the new color to the color that we
are given in here. Move this down. There's a bit of mismanagement
theorem, but that's okay. So now when we play,
we stand inside. Yes, there we go. Now it should shift to green. There we go, which
was a bit fast, but it's okay then why? Then when we leave,
it plays in reverse. It goes to green, red, and then it should
go slowly to white. How cool is that? I hope you enjoyed this video. Congratulations on finishing
the section number wherever. And I'll see you
in the next one.
34. Section 6 - CyberSpy 3027 - Moving Platform - Creating Our Moving Platforms: Welcome back my fellow
game developers to a brand new long video, to a brand new long section. Also, I know this video is long. I know you're tired
of long videos. I hate them also, but trust me, it is so worth it
because we've created the most advanced thing
we've done so far. Look what happens when we play
a platform that is green, moves to a certain location
and then moves black. And not only that, it's also
made of freaking glass. How freaking cool is that? So let's not waste any more
time and let's get started. I need your full concentration because this is a
very crucial point. You need to fully understand
everything that's happening. And that's why the video as
long because I go through everything in my new
details as much as I can. Let's get started. Okay, so it's time
for the fun part. We are back in our main game. It's time to create
a moving platform. So we're going to start
off by, first of all, importing the glass
material because I really don't have time to create
the material right here. You can do it if you want. It's a very simple guide. But all that we need to do is we need to go to the content, right-click on this folder
and go to show in Explorer. This will open up the
folder for our wherever, where the unreal projects are and where the
unreal pack is. Why are we doing this? Because we need to import the resource material that
I've provided you with salt. Keep in mind what I'm
going to do right here. I'm going to select
the platform. You will get a file, which is the glass material. You will unzip it
and then you will have inside of the
platform makes sure that you take out
this platform and you drag it into the comment, you should see the folder
appear right here. Now, if we double-click
on the platform, you'll notice that there
might be nothing in here. So I'm going to restart
this program and hopefully we shall
find the glass inside. Okay, welcome back. So right now let's go to
the levels, the level 0. And we should see right here in the platforms that we
have this glass material. Now if I double-click
on the glass material, you'll notice there
are a lot of nodes. All of this I did on my own. Well, I'm just getting ahead. I actually went online and saw how we create a glass material. There's no shame in not
knowing how to do everything. I recommend you go through, maybe create your own material, maybe you want some
kind of lava material. I recommend that you
try different things. Anyways, no, let's
not save anything. Now it's time to
create the platform. I'm going to right-click
in here and the Blueprint Class
irrigate an actor. This will be called BP
underscore moving platform. Hit Enter. Open up the moving platform. First thing I'll do is I'll
create a cube in here. This will be our ground, and this will be
two by two by 0.3. Let's see here, Let's move
it up the ground a bit. So this will be our
moving platform. I'm going to add the
glass material to it. So there we go.
This is the glass, as you can see, it
is transparent. I will call this the
moving platform ground. And I'm going to go ahead and
add another cube in here, which is going to be
one of the edges. Let's make p
dimensions properly. So 0.03, then it's going to be 2.03 and then it's going
to be 0.03. There we go. So this is our first edge. You'll notice that it is just slightly bigger because we
will have a second edge, and I'll just call
this the edge. I'll duplicate this one. This will be our second edge and this one is going
to be 0.030.30.03. Okay, there we go.
So this one will be the edge which
is on the side. I'm going to rotate
it like this. And for some reason
decided to not be. So I'm going to actually, you know what, let's move
it to the other side. There we go. Minus 90. Move it like this. We'll just reposition it to
be properly on the side. I'm not going to waste your time and be
doing all the edges. I'm going to use the
magic of editing. And then when I come back, everything should be settled.
You should do the same. Okay. So as you can see, I've created a casing
around our glass platform. Now, what did I do that? Because I want these
edges to represent whether the moving
platform is on or not. So simply drag these edges, select all of them and drag them under the moving platform. Now what I'll do
is I'll make sure that we're selecting
all of these edges. I will make them all red, which is the red
glowing material. Now if the platform is red, you'll know that
the platform is not working and will need
to be activated. And if it's green,
then we'll need, then we'll know that it is moving and it is
activating solve. This is just a small
little trick I want to do. Now it's actually time to
start moving this platform. First thing we'll do is we'll create a new variable in here, which is going to be
called the is on. And it's going to
be a Boolean and it's going to be
instance editable. That variable will be true. If that variable is true, then the platform is on. That means it's moving. If it's not, then it's going
to be off and not moving. But not only that, it is also going to change
the color of the edges. The first thing we
need to do is we need to go into the
construction and we need to make sure that we get a reference to all
of these edges and set their color because we will be setting their color
on the begin plate. How are we going to get a
reference to all of them? We are simply going to open
in the variable and we'll see that we have a reference
to all of these edges. Now, the problem is we need
to add them one by one. So I'm going to do
this really fast. Okay, so now that I've
added all of these, if you were worried like
this does not look good, what you can do is
select all of them. Right-click and you can
see right here that we can align them to the right. So now all of them are aligned
and we can also align them and make a vertical distribution so all of them look really nice. Now the next thing I'm going
to do is make an array. So I'm going to
right-click in here and type in make array. I'm going to add as many pins
as we are going to need, and I'm going to start
attaching all of them. So this is something
for you to do, pretty fast case. So now we have this array. And the way we're going to do this is we're going
to promote this to a variable and it's going to
be called the edges array. And we are going to set it
as soon as we start our, not even when we start
upon construction of our moving platform. There we go. Now we have
a reference compile save. Now in the event
the graph will just delete the overlap and
the event thick. For now. What we need to do in the
event that graph is we need to determine whether
the colors will be read or they will be green. From the event begin play. I'm going to create a
branch on this brush. The condition is
going to be as on. If it's true, we're going
to get the edge arrays. Excuse me. We are going
to get the edge arrays. And from the edge arrays, I am going to create
a for each loop. Now the foreach loop is
similar to the for loop, but the difference
is that it works solely for the purpose
of using items. So for each, meaning
that we go through each item in an array and we provide the for
each loop an array, and it goes through
each of the items. And we'll do the same
right here for each. So basically what we're doing is we're going through
each one of the edges. And then we are going to, from every single element, we are going to set material on every single
one of these elements. So if the, if it's on, then it's going to be green. The green. And if it's not, then it's going to be obviously, there we go, compile save. So what's happening in here? First of all, the construct, we get a reference
to all the edges. When we begin to play, we check is the platform on. If it is, then we're
going to go through each element of the array and we're going to
turn it to green. If it's not, we'll do the same, go through each element of
the array and turn it red. Let's see how that looks. Make sure that this is on, is instance editable in
level 0. I'm going to Add the moving
platform. There we go. Move it up a bit. So now when we play, it's all red because
the is on, is off. Right? Nice one. And then when we
turn this to true, then we'll play the
game. There we go. You can see that the
edges are green, meaning that this platform
shouldn't be moving. Now, let's move on and
actually start making this platform movable
back in here. Before we even set the
material of our platform, we need to set the
relative location. So I'm going to drag from the beginning play set
relative location. And we're going to set
the relative location of the moving platform a
grant. So click on that. That's the one that we
are going to be moving. So put this right here and
put the moving playground, moving platform ground under it. And why are we moving the
moving platform ground? Well, because it's the main
object that needs morning. So now we need to set a new location and I'm going to promote this to a variable. And we'll call this
the starting location. Hit Enter. There we go. So now we
have starting location. I'm going to make an instance
editable and I'm going to expose it to a 3D Widget. Combine safe will not need to test this out
or you know what? Let's test this out. I'm going to select
the 3D Widget. I'll just set it
in here somewhere. And now when we begin
play, There we go. You can see that the platform
moves to that position. Excellent. Back in the moving platform. Now we need to start moving it. So after we send the
material and if it's green, we will be moving. If it's thread, then no
need to do anything. So from here, I'm going to start the move component to what
components should I be moving? It's obviously the
platform ground Sort drag and the platform ground into the components
that need moving. Let's set it right here. Then we're going to set
the target location. I'm going to promote this to
a variable and it's going to be the target location. Or let's call it the
location, two moles. To set it under here, just for the sake of having everything really
nicely organized. And then we'll select
the location to move to set the
instance editable, show 3D Widget, combine, save back in our level. Now we have this
starting location and this location to move to. I'm going to set the location
to move to about here. So now when we play the game, boom, boom, there you go. You can see it went
from this position immediately to this position. But this is not something
that we want because it's very fast and that's not
what we are looking for. So I'm going to go back. Instead of doing,
doing it that fast, I'm going to use these
ease out and ease in. So I'm going to right-click
promote this to a variable and set it
on both of these. I'm going to call
this the easing. If this is true, then it will slowly move to the
other position. So make it an instance editable. And what else I'll do. I'll also make sure to have this overtime promoted
to a variable. I think we should move
these right here. Maybe it's better. I don't know. It will depend on
you. I am I'm feeling that it's better to
move it like this. Yeah. I don't know. I don't know why.
Whereas veterans tier. Tier Yeah, I think here it
is better to over time, this will be the time
that it takes to move from the initial position to the position we
need to move to. So this will be the move bim
and Enter, compile save. And the move time will
also be instance editable. And that's it. That's all. It needs to be. The most time default value. Let's just give it two seconds. I'll compile save. And the default value of the
easing should also be true. So now look what happens. We're going to select this
platform and the easing is on the move time as to when
we play, look what happens. Replay. There we go. And I
hope you'll really noticed how the easing in effect works because it didn't just go to that position
and stop there immediately. It slowed down
until it got there. So notice that again, look. How cool is that? There's a slight difference
if we remove it. Let's see how that looks. I don't like that that
jerky movement easing in much better if we increase
this full five seconds, for example, and play
the game. There we go. We can see that our
platform is moving slower. How cool is that? I'm super excited, but there is a small problem left to solve. We want this platform to
move back from its location that they've got to back
to its starting location. And I'm already to
deepen this video. I don't feel like doing good, so I'm going to give it
to you as a challenge. So pause and go back. After we move the platform, create a delay that
will pass at the point, promote a variable pos time so we can control the
delay that happens. Move the platform back to
the starting position, and make sure we keep
doing this in a loop. And if you want, I can give you a hint. If you don't want the hint, pause the video right now
and go do the challenge. And if you want the
hint, I was still here. Okay. Connect the delay to the
first node of the moles to move component to
stop that information, pause the video right
now and go do a shallow. Okay. So I hope you'll challenge. I hope you tried your best. After we moved to the location
that we need to move to, I'm then going to have a delay. And then I'm going to go ahead and move back to
the starting location. So I'm going to duplicate all of this in here, set them off. But instead of using
the Move tool location, I'm going to use the
starting location. Oops, there we go. So I'm going to move
the starting location. We're going to use
the same warming because it's much more
practical like that. And after we moved back
to the starting location, what we'll do is we'll
have another delay. And then after that
delay, excuse me, we're going to connect
back to the smooth tool. And I'm going to see again, I select this nope. Source, select this
NADH, right ear. This one can be deleted, completely deleted,
and we'll add this one right here. And there we go. So by the way, if you are wondering why
I'm zooming in so much, because if I zoom out a bit, you will start to see
everything fading out, especially if you are on
not a high resolution during the score
student watching scores while you're
watching this course. The last thing we forgot to do is to promote this
to a variable. This will be the bars. And we'll set it right here. And we'll also make sure that the Palestine as applicable
right ear compile, save and the boss time shouldn't be normal than
than 1 second I think. Let's see how that
looks combined safe. So let me just one more time explain what's
happening. Festival. The platform arrives. We set everything
into an array and reset that array called
the edges of rape. Then on the Begin Play, we take the moving platform and we set it at the
starting location, which is an instance
editable and shows a 3D widget that we
can set in the world. Then we go to a branch. This branch checks if the
platform should be on or not. If it's not, then
we'll get the array. We'll go through each and
every element of the edges. While the edges
array, we go through every single edge of that array. And then we said the
materials to read. If not, we're going to
set the material to green once the
materials are, I mean, if it's on, then we
send the material to green and then we will
need to start moving. The platform arrives
in the world. It's set in the starting
position right here. Now it needs to move to the location to move to
with a bit of easing and a bit of time in-between time it needs to go to that position so it
doesn't simply snap there. Then we delay for a
certain pulse time, then we move back to the
starting position also with, with an easing and
also with angels time. Then we bars at the
starting position and we go all the way back to
the location to move, to compile, save, and
let's see how that looks. There'll be goals, so it
goes to this position. It should wait 1 second, and then it goes back to
its original position. Now it waits there 1
second and it goes back. How cool is that we are
actually making magic, ladies and gentlemen, thank
you so much for watching. Sorry for the length
of the video. I hope you enjoyed that and
I'll see you in the next one.
35. Adding Activation Plates : Welcome back, My favorite
game developers. In this video, we are going to be creating an activation plate. Now when we run the game, we no longer need to set the
moving platform manually. We can just use our
handy activation plate. And once we stand
on it, there we go. You can see that
the plate is turned on and now it moves
from one side, from one location to the next. So let's not waste
any more time. Let's get started the k. So now we have our
moving platform, but the only problem is, is that we don't want to keep going through that
platform and turning it on and off from right
here from the details. We want that to happen in game. And in order to do that, we will need to create some
kind of activation platform. So let's go ahead
and do just that. So I'm going to go into the content on the
where should we do it? I think we should
do it right here inside of the platform folder. If you want, you can create
one separate folder. In here. I'm going to create a blueprint which is going
to be an actor and call this VP underscore
the deviation Plate. I'm creating it inside of
the platform because I feel that this is actually part of the platform because
without the platform, the activation plate
will not do anything. But if you feel that the
activation plates or should be responsible
for something else, then be my guest predated
in a separate folder. I'm going to open this one up. Then I'm going to go ahead
and create the Cuban here, make it 0.3 on the z
axis. There we go. We can see that it
has a bit of height. And we'll just make it two
by two on the x and the y. Then I'm going to call
this the outer edge. I'm going to duplicate the
outer edge and make it 1.8 by 1.8 by 0.2. Let's see how that will look
and I'm going to move it up a bit and this will
be called the globe. This glow is going to have
a red material aren't. So this bonding will
be all the time read until we stop on it and
then it becomes green, I think would be a bit smaller, maybe 1.6 by 1.6. Yeah, I think that
looks good enough. Maybe move it up slightly. There we go. So it looks
kind of like a button and I think the 1.6 is
good enough for me. Okay, great. So Compile Save. Now we're going to go ahead
and add a box collider. And this will be the
trigger and the trigger. I'm going to scroll
down and create an over or on begin
overlap event. So on begin overlap
event of, sorry, before we do that, back in the Trigger, let's actually set
this properly. So we're going to use this, we'll use these tools
is actually the same, but I just like having, since we have this
option, why not use it? I'm going to create this extent. And I'm just going
to move it up a bit. There we go. So it's
just hovering above it because we don't want it to be triggered
by this platform. Maybe it won't be,
it probably won't, but just in case compile, save back in the Event Graph. So in the ear, we're going to delete the begin the
thick and the whatever. Then in here, what we're
going to do is as soon as the player move,
moves through this, we are going to turn
the globe material or the glow cube material
into the green. So we're going to do this only once because we
don't want to have multiple instances
of this just in case because sometimes overlap
does something weird. So we're going to do once and we're going
to get the globe. And from the globe we're
going to set material. And that material is going to be the green material.
So there we go. We set it to green. I know sometimes
these little things in here are very hard to see. I don't know. That's just the problem
of Unreal ligase. What can I do? So the green material from the globe with all
the swans combine, save back in our level. We're going to add
this right here. Now we're going to play. And when we come in
here, there we go. You can see that
we have triggered, it was red and now
it became green. I think I'm going to
make this smaller. Let's make it 1.5 by 1.5, because I want this
to really be defined. So let's see how that looks. When we play the game. This is our platform,
we know it's red, that means we need to push
on it and boom, there we go. Now it's green. Excellent. Now, what else should
we be doing in here? Well, obviously in
the obvious question, the obvious answer is that we actually need to
connect this platform. I mean, this triggered box or this activation blade
to the moving platform. How are we going to do this? We are going to create
a dispatcher event. So I'm going to go back
to the activation plate. I mean the moving platform. And in here before we set
the relative location, I'm going to instead create
a dispatcher events. So I'm going to close
down the variables. I'm going to add a
dispatcher event and I'm going to call this the act, the platform. I'm going to drag
it into the world. And I'm going to say
that we want to bind. So I'm going to set
these execution pins. Now, why are we
going to bind this? Why are we choosing to bind? Because we're going to
bind this to an event. And what is that event? Well, it's going to
be a custom event. I'm going to
right-click in here, and I'm going to write custom, oops, add custom event. There you go. We can see
that we have it right here. Once we added, will be prompted to create or
sorry to name the event. I'm going to call this activate. The way we bind this
by simply joining these two red boxes right here. So what happens now? As, as soon as we begin plate, we are binding an event before we set the relative location. And then what happens inside of the Activate is we
are going to set, actually we'll just
going to grab the zone. Whereas the variable of
the exam, There we go. We're going to set the
variable to be true. Then we are going
to move this a bit. We're going to go ahead
and set the branch and the condition will be
the variable of the exam. How am I going to make
this a bit better? There we go, it
seems really good. What's happening in here? We're starting the game. We are binding the activate, but we are not
triggering this event. What we're doing is
binding the event, setting the relative location and checking the
condition on the branch. If it's already on, then no problem, the
branch will start moving. If it's not on, then we're going to set the material to
read and that's it. But what now we did with this activation and
setting the branch. Now when this activates,
it's called upon, it's going to set
the is on to true, and then it will
go to the branch. And then it's going to set the material and do all
of that good stuff. Now the only thing that's
left to do is to actually call this Event Dispatcher
the activation plate. Make sure to compile from
the activation plate, and that is going to
be your challenge. Your challenge is to call
the activation event, create a variable of
type moving platform in the activation plate. So what the type of the variable must be
moving the platform, it's an object reference. Use the data pen to call the
activation of the platform. So once you create the variable, you'll need to drag it into
the Event Graph obviously. And then from that, you use the data up and to call the activation platform event. At that should, after we set the material and back
in the game view ports, select the pressure plate and assign the platform
you want to move. So obviously this
moving platforms should be an instance editable. Pause the video right now
and go to the each hello. Hey, welcome back. So in the activation plate, we are going to create
a new variable. And this variable is going to
be the flat forum activate. The type of this
platform is going to be the activation plate and it's TBP underscore
activation blade. Excellent. We're going to set the instance editable and
we're going to compile, we're going to save. And we're going to go to the Event Graph after
we set the material, we're going to drag in
the platform to activate. Keep in mind whenever
we're dragging hold down control to get a reference, hold down Alt to set. Then we'll drag from
here and we're going to call the activate. Okay, So a bit of a mistake that I made and let's see in here, the type of variables should be the moving platform, okay? Yeah. What can I say? This is of type moving
platform changed the variable. There we go. Remove this, jack, this back in, and now we should
see the Activate. There we go. So as you can see, I made the mistake. I really wanted to
keep this mistake and because I could have just added this out sometimes I do if that mistake isn't good enough or do I mean
by good enough? I really think
that you can learn something from this
mistake that I made. So I would love to keep it. I hope you don't think
that I'm very bad. This is the way I like to teach. I like to keep my
mistakes just for you to know that not
everyone is perfect. And I also do a lot of mistakes even though I already
created the scores. So keep in mind, I
already did this project and I rehearsed it and
I plan it all out. And I also make mistakes, so don't be afraid to try to make mistakes
and to learn from them. We save everything
we are activating. We'd go back to the level. And on the activation plate, I'm going to select the
platform to activate. Now, we can either select it from the drop-down
list or we can use this little pick actor and then select this
moving platform. And there you go. You
can see that this is the movement
platform right here. Play the game. This is active already
and select it again. Don't have this
on, play the game. So now the platform isn't
moving once we press it. Oh my God. Don't tell me. This is not one of the coolest thing you've
been. Very smart. Thank you so much for watching. Sorry for the mistake. I hope you learn. I
hope you can see that not everyone is
perfect and I hope that you see the
benefit of always trying to do these
challenges to learn. So see you in the next one.
36. Creating Enemies Using Timeline: Welcome back, my fellow
game developers. In this video, we've
created ourselves a little flaming demon enemy. As you can see, he has
flames all around him. But not only that, when we play the game, he starts moving
from 1 to the other, trying to kill us. But that's not the catch. The catch. I mean, we can set the speed. We can set him to be slow and
we can set him to be fast. And there you go. You can see that we have control over him
using timelines. So let's not waste any more
time and let's get started. Okay, so now we are going
to be creating an enemy. But even though he's
not part of a platform, so this section is mainly
focused on platform, But the enemy will
use a timeline and we learned the timeline
in the previous section. So I think this is the
perfect place to create one. We're going to create
a new folder in here. This folder is going to
be called the enemy. And we're going to
double-click inside the right-click and
create a new blueprint, a class of type Actor. And this is going to be the BP. Bp means blueprint, just
if you need a reminder of. I never said that. The NMI there we go. So VPN underscore enemy, open up the blueprint enemy. Now in here we're going
to add a sphere or going to call it the enemy body. And we're going to move this enemy body up a bit
and we're going to make him 0.3 on all sides. Wait, let me reset
this and make the make him 0.3 on all sides. Is it too small? I don't know, To be
honest, maybe he is 0 or maybe it's better. And then we're going to add a particle system right on
the top of this guy's head. So once we've added it, we should see the template where the particle system
should be, the fire. There we go. So now this enemy is
made out of fire. He's a flaming bold
going towards us. And we're going to
change the enemies body maybe to read if you
have some kind of red. Now we don't, let's see if
we have something black. We have something very black. Let's see, maybe we can
create our own. Maybe. I don't know. We can create this
kind of totally black you or
something like this, like the metallic ball
that's flying towards us. Compile save, I think
this is good enough. Back in the event the graph, Let's delete the overlap and the tech will
only be needing the Begin Play to
start the timeline. So we'll add it up. We don't even need the beginning
play to be honest with you. On the timeline. We're going to call this
the fast moving enemy. And why is it the
fast-moving enemy? Well, because you'll see later on from the fastboot
moving enemy, we are going to double-click
in here and we're going to create a low track. This flow track is going
to be the movement. We're going to add three
points in here, or three kids. And we're going to set
the first one to be 00. The second one is
going to be 1.51, and the third one
is going to be 30. And the length of this whole
thing is going to be three. So we're going to
expand it on all sides. There we go. So now we have all points. Now this variable will go
from this value to 1.5, the 1 second, and then on the third second is
going back to 0. I'm going to right-click on
the key and make it auto. And right-click in here
also make it although, and then pull this one down. So we have this nice
smooth movement compile, save back in the Event Graph, and now we have the movement. Now what we're going to do
is going to be a bit weird, but don't worry about it. We're going to learn
this movement. And what does that mean? Well, if we hover over it, and I don't think this is
the alert PR looking for. We're going to right-click
and learn vector. So when we learn vector, if we hover over it, you can see that this is
a linear interpolation between a and b
based on the Alpha. Meaning that using this, we are moving from a, from vector a to vector B. A certain speed,
which is the Alpha. So can you guess what the a, b, and alpha are long to be? The a is going to be the
initial position of the enemy. The B is going to be the position we want
to move the enemy to. The Alpha is going to be
the movement that we are getting constantly from
the fast-moving enemy. Then we're going to, the a is going to stay 0. So that means where
we set the enemy, that's where the enemy
is going to start. But the B is going
to be promoted to a variable and it's
not going to be called B if I can catch it. It's going to be the
ending location. By the way there, we could have made the enemy move exactly the same way as we make
the platform move. But I want to show you as
many ways to move things and have the opportunity to use timelines so you
can get used to them. Then after this, we're going to also promote the
variable right here. And we are going to be
updating it all the time. And what shall do we, what should we call
this variable? While it will have many names, but I think we should call it The shouldn't be the
ending location, it should be the movements. So it needs to be
something that represents the movement from a to B. I'll call it the enemy
destination, enemy nation. It's not a very descriptive, but add on or we can add
a tooltip if you'd like. From this enemy destination, we are going to set relative
location of the enemy. Baldi, said relative location
and the location that is going to be set is going to
be the enemy destination. Now, we could have simply use the enemy destination
that we get from here. But because we are
going to later on add more movement
for the enemy, or actually you're going to be adding more
movements to the enemy. That's why I decided
to keep it like this. Compile, save. And now the ending location
should be instance editable and it should
show through the Compile, Save back and our world. Let's go ahead and
add an enemy in here. So I'm going to simply
drag and the enemy. There we go. You can see
that he has his fire on him. And you'll notice
that the ball is a bit higher than the
point right here. We can fix that by simply going to let me just close
these two down. Going through the
enemy viewport. Let's see the ground, the floor. As you can see, sometimes
we get this error, but we simply can
reset this to 0, compile save back in our world. So this is the enemy. Let's select the
ending location. We will move it right here. And now when we hit play, nothing happens because
as smart as I am, I forgot to go into
the fast and make sure that we are in auto-play
and we are looping. So Compile, Save. And now when we
play, There we go. You can see that the enemy is going from this direction
to this direction. And the ending
point is where it's where we've set it all the time. But the problem here is, if I set, for example, the destination right here. Now what's going to happen? Now the player or the enemy
is moving extremely fast. So you can see he bounces from
one location to the next. What if we wanted to
make a enemy that is a bit slower and more
fair to the player. Well, we're going to
create an enum for them. If we right-click in here, go to the blueprints
and select enumeration. This will create an enumeration. We're going to call
this the enemy speed. Speeds or types. Let's call it types. It seems more filling. And if we open up
this enumeration, you can see that we create, we can create various types of enemies, not exactly enemies, but this will allow us to create various types of enumerations, which will effectively create a separate variable that we
can choose from an order set, the player or the enemies speed. I'm going to call this the fast, the medium, and the slope. Now we have these three
types of enemies. We can simply save
and close this down. Now I'm going to issue a challenge to set
the enemy speed, create two other timelines, one of longer length
and make sure to adjust the keys for each and
turn autoplay off. This is very important. Next for every timeline set, the lobe and the
destination attached, attach all of them to
the set relative speed, create a switch gate based on the new enumeration
recreated. This will be a tricky part
and make sure to connect. All the timelines store it. So remember the switch that we learned a couple
of videos ago. Well, this is your moment
to shine, to use them. So make sure to use a
switch that is based on the enemy enumeration
that we just created, which is called enemy
types, I think. Finally promote the
variable inside of it and make it
instance editable. So you'll need to promote the variable on the
switch so we can change it for every single
enemy and test it out. Make sure to also connect the switch though
they begin plate. This is something I believe
I forgot to mention. Pause the video right now
and go to the challenge. Okay, Welcome back. I know it was a very
tricky challenge and I know you're not already
familiar with enumerations, but bear with me and you'll understand what
everything means. Back in the viewport. I mean, back in the event graph, I'm going to duplicate this timeline and actually
doesn't do anything. So back in here, this is going to be the
medium moving enemy. This is the second timeline. Then we'll duplicate it again, and this will be the
fast moving enemy. Sorry, slow moving enemy. And let me just open these up so we can see fully
what's going on. And from these, I'm going to
open up the medium moving enemy and he's just going
to be a bit faster. So instead of the
1.5 is going to reach his maximum
velocity at maybe two. And his minimum velocity, or meaning that he's
going to go back to 0 at minute for AD second four. And this right here
should be the value. Why isn't that in the middle? Because this one starts at 0, this one ends at four, and this one is in the middle. But we need to adjust
the variation. We need to turn off auto
play and we need to make this four seconds long,
compile, compile, save if you want, we can actually
make this one a bit slower so that the
medium is more slow, but I don't think so. So back in here. So we have the medium down. Let's do the slow one. This one instead of 1.5
is going to be at three. So it's telling me that I
already have a key there. So this one is going to be at six and this one is
going to be three. I'm going to adjust
this like this. There we go and make the
length six compile, save. So now we have three various
or different timelines, each having a certain speed. So now I'm going to simply get these and duplicate
them two times, attach each one of
them to the Update and attach the Alpha, the movement. And I hope you can see
properly what's going on. So I attached the movement of the Alphas and the
sets to the sets. Then I'm going to
add all of these. There we go. That's why we created a variable for the
enemy destination. Or actually we used a reference
for the enemy destination instead of later on. Instead of using the immediate
that up and from here, because each one
will set its own. Now for the tricky part, we're going to create
a switch node. The switch based on the, on NME types that regard. So as you can see, we
have three outputs, each for the fast
medium and the slow. How cool is that we created the animal iteration
enumeration, which effectively means we
created some kind of type. And now we have the
selection right here, which we are going to
promote to a variable. And we'll call this
the enemy speed. Once we have this, look what will happen now. Will compile, save everything shouldn't be working properly. There's just makes
sure the autoplay is turned off on all of them. Compile save back in here. When we select the enemy, we have the option to, we didn't make an
instance of the bull, the enemy speed instance
editable, compile, save. And you'll notice what is the
type of if you click on it, if we tried to hover over it. Let's see if we can see
it properly in here. If we hover over it, the variable enemy speed. So we basically created a
variable of type and in speed, we can see this also
in here, enemy speed. So the type is an
enumeration type, but it's the enemy types that we have that I say enemy
speed, you sorry, I meant the type is of type enumeration and that enumeration as what we
created right here. So back on the enemy, we can set it too
fast, medium or slow. So if we sat him too slow, we play the game. There you go. We can see that he
moves slower right now. If we set them second
too fast, There we go. You can see that
he bought around, which is not fair, especially if your character
isn't moving that fast. And if we sat him to medium, we play the game. There we go. We have a medium
moving enemy and our world. I hope you enjoyed this video. I know the enumeration
type is a bit hard. I know the challenge was probably not that
fair because you're creating a very
new things you've just learned how to
create timelines are now Michael is asking out
of you to create some kind of switch on some kinds of enumeration types then whatever, all of this is mind-boggling, but trust the process, the challenges do your
best and the challenges, I hope you understood
what's happening in here. If you have any questions, you can always leave them
down below in the Q&A and the discussions AND and OR you can ask them
under discord channel. I hope you enjoyed this video. See you next time.
37. Section 7 - Making Interactive Experiences - Game Mode and Game State: Welcome back, my fellow
game developers. In this video, we are
going to be learning above the essence of our game. So we'll be learning above the Game Mode and how
the world interacts. Congratulations on making
it to the section. I hope you're enjoying
the course so far. If you are, please consider
leaving me a review. It helps me out a lot. If you don't think I
deserve a full five-stars, what an excellent review. Please contact me, tell
me what I did wrong. How can I improve? I always aim to
please and bring you the most fun and interactive and best possible teaching style that I can conjure up. Let's not waste any more time. Let's get started. Look game modes. Okay, So in this section we are going to learn
information about high level gameplay programming and scripting in the
Unreal Engine with the aim of making
interactions between the layer and the world easier
and more understandable. To this point, we
would play the game, we wouldn't know
what's happening. We just become
either some kind of floating thing or we wouldn't become some kind of
third-person guy running around without
any knowledge of why and what is happening this
time around this section, we'll learn everything
about what is happening. So first thing we're
going to learn is about the game mode
and the game state. The game mode, something in the Unreal Engine that
can be used to determine, for example, the
number of layers and speak spectators
present in the game. It allows us to know how
players enter that game, whether or not the game
can be paused or not, the transition between levels, all of these things can be handled inside something
called the Game Mode, which we'll see in just a bit. We also have something
called game state, which is similar to
the Game Mode button, the game state, for example, we can determine how long the
game has been running when each individual players
joined the game, the base class of the
current game mode, and whether or not the game
has actually even began sort game state is usually associated to a multiplier
multiplayer game. While the game mode is what we are going to be focusing on, because an outgoing game, there's nothing too much
spectacular that will need to know about the game state,
isn't that necessarily, but I thought it would
be a good idea for you to know that
there is something called also a game state that's deeper into
the game mode. Back in the Unreal Engine, you'll notice I'm back at
the my first-person game. My first game, I mean project. And let's get started. So why certain fundamentals
like the number of layers required to play or the method by which the players
joined the game. So do they appear that
they fall from the sky? They like after they die
or so all of these things, these are common to
many types of game. Limitless rule
variations are possible depending on specific
game you're developing. So as you know, if
you're a gamer, there are endless rules for
any game that you can have. So this is where you do it. You do it inside
of the game molt. And regardless of what rules, these are, game modes are designed to define
and implement them. We have something called
the Game Mode blueprint, and it's possible to create your own blueprints for
the Game Mode classes. Let me demonstrate
what I mean by the game mode before
you create your own. So if I open up the content and if we go to
the crazy world, for example, actually maybe this is not the
best list to show you how, what I mean if we go to the
volume testing saw in here, you'll notice that we
don't have anything. We just have this later
start right here somewhere. So this one, the player stock, and once we started the game, we just start blank. So when we play the game, we are the
third-person character without any freaking reason. Why is this
third-person character available for us to play? Well, that's because
of our game mode. If we go to the window and scroll down until we find the
world settings, add that. This will open a small window
right here to the side, next to the details. And you'll notice that we have something called the
Game Mode breath here. And the override is none, meaning that we are
using the game or game mode default to all the levels inside
of this project. And if we click on the
selected Game Mode View, you'll see there is nothing. That's because we didn't
apply any sort of game mode. If I, for example, select in here,
select the Game Mode. You can see that now there are these little
options right here, which is the default bond, the hard class,
they are invisible. That's because the game mode, this is the very standard tone. But now what happens
when we play the game? You'll notice there is no
more third-person character. Now, why is that? Well, because we are no
longer the third person. We are actually the default
bond that floats around. And I would like to show
you the default bond, but I keep it to the
four. The next level. If we go into the edit
and the project settings, we go to the maps and
modes right here. You'll see that the game mode, the default Game Mode, is the third person game mode. And if we click in here, you'll see that it's the
third person character. So whenever we start the game, because the default Game Mode was before we changed it
in the world settings, the third person game mode, whenever we start the level, we start off with
a third% character as the default bond class. And it's the same for
the player controller. It's the same for all of these. So let's go ahead and
create our own game mode. You'll see if we click in here, we can select the third
person game mode. And now when we
play, there we go, We're are the third
person character, but we can change them if we click on the third-person
character here, and we select the default bond. Now when we play the
game, There we go, you can see that
we are no longer this certain
third-person character and we can fly around. We can still interact
somehow with the game, but we'll see how we can
change that later on. So you are beginning to see how the game mode can affect the
world and how we play in it. Now that you've understood
what the game mode is, obviously not the full
scope and range of width. Let's create a new game mode in the Content Manager
browser, wherever it is, right-click and create
a new blueprint with the parent class being the Game Mode base name of the BP underscore
my Game Mode. Open the world settings
window for you to find. For some reason I've just showed you override the current
game mode with your own. I'll give you a small hint. It's in the windows
when those settings, world settings,
obviously, when I did this challenge,
I wasn't expecting. I have a certain idea of what
I'm going to talk about, but I always try to
keep things fresh. Pause the video right now, and go to the challenge. Hey, welcome back. So I'm going to open
up the content. I'm going to go in here and the continents
right-click am going to create a blueprint
class is going to be based on the
Game Mode base. And I'm going to call it the
BP underscore my Game Mode. Open this baby up, drag down right here. And as you can see, the game mode is exactly the
same as any Blueprint class, but it still has a bit of
difference when you come to, when you go into the
nitty-gritty things. But for now, all that we need to do is simply go to the
game mode right here. Click and select BP, underscore my game mode. And you'll see all the settings that have been set right here. Let's talk about the sum of these settings and the ones that we are going to be using, mainly the default bond class. This is very important once
we create our own character, we will be setting
it right here, but we will be actually
setting it right here for this game more than
the class settings. Then we have the Hulk class. This is something in my
opinion up with outdated. We'll be using something
different to create the hot in our game, the
player controller. This is very important because currently all the
movements that we're using for the third-person character
are already predetermined. We are going to be
creating our own later on, we have the game state
that we talked about. We have the player state, something similar
to the game state, but obviously more
associated to the player. And finally, we have
the spectator class. This is just in case you die. For example, like a game in
a game of Counter-Strike. Once you can roll them around, you can determine
whether you can roll morale or you can't roam around. So this is the basic
things over it. Now when we play the game, you can see that
we are the palm. And if we go into
the game mode right here and go to the
class default, you can see that in the classes
we can change the things. So for example, the
default font class, Let's set it as the, what should we, should reset it. Let's set it as the
third-person character, for example, compile, save. And now when we play
the game, there we go. We are the third
person characters. So you are beginning to see how this will affect the game. But before we continue on, there is one more thing that
you need to understand. And that is that this game
override if you hover over it, this is the default
game mode to use when I'm starting this
map and the game. So when you are using this map, when I go to the level
of the crazy world, not just the difference that the game mode is back to none. It's back to using
the one that was in the project settings and
the maps and game modes. If you don't override
the game mode, it will simply use
the default one that is available right here. With all of that information, I hope you enjoyed this
bit of introduction. Later on we will be using the Game Mode much
more extensively, especially in our game projects. So thanks so much for watching. See you next time.
38. Pawn: Welcome back my fellow
game developers. And in this video
we finally taking things too far because
when we play the game, we are not a floating head. We are not a
third-person character. We have become
officially a table. A table because
that does not move. It just sits there and
it's just watching costs. Let's not waste any more
time and let's get to making or turning
ourselves into a table. Okay, so what is a bond? We've already seen
what the pollen is, but now let's delve
a bit deeper. So basically the is the physical representation
of a player within the world. It is the base class of all actors that can be
controlled by the player AI, meaning the third person player that we are usually
playing around with. What is a pump. The character that we start
flying around with as a bond, as the physical representation of an entity within the world. This not only means that the pond determines
what the player, a player or AI entity
looks like visually, but also how it interacts
with the world in terms of collisions and other
physical interactions. For example, a character
that we'll be seeing later on is a type of bond that has the ability
to walk around and we'll see what all
that means later on. But for now, let's first of all understand what
the default palm. So if I go into my game
world view and change the default bond class to the default bond
and play the game. You'll see that we have this
moving around character, but is it really just some
kind of invisible ghost notes? Not because if you
press the F8 key, you can see right
here that we have this default bond class somewhere in the
world. There we go. So this is the
default bond class. If we move around, you can see that this whole time you were this little ball. How cool is that? You were this little ball
hovering around the world. And if you don't believe me, you can just go ahead
and test it out. And this ball actually interact
with the world around it. This is what gives
you the collision. This is why you
cannot pass through walls whenever you are playing
with this default bomb. To be honest with
you, the first time I realized we were this ball, I was very scared. I was like, Whoa, I've been using Unreal four because I never learned
from a course like you, I never knew that I was the
default bomb flying around. And when I realized
I was super shocked, I was like, my whole
life has been alive. So anyways, we are this ball and let's now explore
this wall a bit more. Because while the bond class
provides only the essentials for creating a physical
representation of a player or an AI. The default bond
class comes with some additional components
and functionalities. So if we go to the Content
Browser right here, we'll right-click and we create a blueprint class
that is a pond. Just call it the, let's
just call it the test bond. So underscore bon,
testing, whatever. Just so we can see
what's inside. As you can see, there's
basically nothing. It's all empty. It's similar to any class. There's nothing too
fancy about it. But if we go back in here, I'm just going to delete it. I don't want it in
my world and you can see how the image looks. Delete this. If you right-click and create
a blueprint class from the default because you can find it in the
common, it's in here. So under the default bond
class, select that, select. And this will be the
BP underscore default. Or on the BP underscore
my default bond. There we go. If we open it up, you'll
see that we already have this mesh component right
here and the components. And we also have the
collision component, which is the actual
circumference or circle or sphere around this smash
component that allows us to hit the walls and
interact with the world. And we also have the
movement component that allows us to float
around the world. So this is how it all works. And if you want, you can
add something in here. So for example, we want
to know, let's able to, a small cube right
in front of us, will add this q,
but I don't know. It's going to look I don't
know if this will work. We're just testing this
out, compile, save. And back in our world setting. Instead of the default bonds, select my default bond. And now we play the
game. There we go. You can see that when
we float around, we have this, we can cube in
front of us the whole time. This cube does not interact
with the world because, well, it doesn't have
any collisions on it. How cool is that now we
have our own personal cube floating around
with us because we created our own the default. Now, all of that information and learning about bond classes, it's time for a bit
of a challenge. And your challenge is
to create a new class. Create a new blueprint of pi
bond called the mind bomb, test at a static mesh to it and set it to
whatever you want. A table is very encouraged
because we wanted to have fun. We wanted to see how
all of that looks. Then add a camera
component to be a third person perspective. So you are looking at the
table from the outside, set it as the default bond class to our game mode
and test it out. So pause the video right now
and go create your own bond. Okay, welcome back. So I'm going to
close this window down and I'm going to keep it just for the
sake of testing. I'm going to right-click
in here and go to the Blueprint Class,
select the bond. This will be the BP
underscore my ball. Test. Open this baby up. Let's go ahead and
add a static mesh. Static Mesh. We go, this will be our body. The static mesh will
be a table. Table. There we go. This is the table,
so now this is us. Next, we're going
to add a camera. We'll add the camera
and we're going to set it on the 3D perspective. So we're going to do it sort of like sometimes the cameras
just a little bit to the left? Yeah. With a bit of an angle. There we go, compile, save. And now I'm going to set the default Python class
as the my bond test. And now when we play
the game, there we go. We are the table and
you can see how we are a bit over the edge now obviously we cannot
move around and I think we are floating,
gave it in there. The FA we are
definitely floating, but that's because
the bone test, you'll notice that we are
over the floor a bit. Maybe we've moved up for
some reason. I don't know. Anyways, as you can see, we can create our own physical representation of a player. Or if you ever have an
AI that roams around, you can also set the
representation using that bond. So I hope you
enjoyed this video. This is just a small
introduction to the bond, even though we will not be delving later on into the bone. It's just good to know what's happening around
you in the world. So see you in the next one.
39. Character : Welcome back, my fellow
game developers. In this video, we
are going to be learning all about characters. As you can see right here, we are no longer the
regular character, but instead we have this little jumpy
invisible guy that just jump on top of this moving
a cube and the world. So let's not waste
any more time, and let's get started with
characters in the game. Okay, so now it's time to
learn about the character. A character as a
bond which has some basic by medieval movement
functionalities by default, what does might be the mean? That means the petals. We have two of them. That means the legs. So whenever you have
a bond that can walk, it's called a character. So let's go ahead
and create one of these characters and see
what they look like. So I'm going to
right-click in here. I'm going to create a
Blueprint, Blueprint Class, make it a character and colors the BP underscore my character. Hit Enter, open
up the character. Let's just close down the
compile and save the game mode. Let's close this down also. The addition of a Character
Movement Component and then capsule component and
a skeletal mesh component, as you can see them right here, the character has
these properties of the bipedal movement and extra
movement functionalities. A character is designed for
vertically oriented players. So meaning any human being to represent the
walking or running, the jumping, the flying, and the swimming
through the world. This class also contains
implementation for basic networking and
butter of input models, but we will not
concern ourselves with the networking for now. Let's just move on and see these components
and explain them. First of all, you can see
that we have the capsule. Capsule. This is used for the bounds of the character and for the
detection of the collision. Next, we have this little
arrow pointing out. This is useful to indicate which direction the
character spacing. We have the skeletal mesh, which is unlike the Static Mesh, not the skeletal mesh that is the representation of the body. So you can easily
keep it empty if, for example, creating a
first-person character or you can add the
third person guy. So for example, you can add this mannequin female or
mannequin man and whatever. Finally, we have the
character movement. And the Character
Movement Component is an actor component that provides an encapsulation
movement system for common modes of movement
for a humanoid character, including walking, falling,
swimming, and flying. And the character movement is basically the heart
of our character. It's where all the
functionalities come from. And you can see we
have many, many, many things that we can adjust
right here in the details. I mean, look how
long this list is. Obviously we're not going to go into every single one of them, but it's good to
know what we have, almost what we have in here. First of all, you can see we can adjust the grab the scale. We can set the
maximum acceleration, the breaking friction, the mass, and all of that good stuff. But we can also adjust the specific things such
as character walking, character movement
walking, for example, the max step pipe. So if we come into
some kind of step, how high will that step B
until we cannot jump over it? This is very important, the walking floor angles. So if we have an angle that is, for example, 90 degrees, Can we still walk up? But no, I don't think we can. We have the ground
friction, the max, walk speed, and all
of these things. Next we have the
jumping and falling. You can see that we have
the jump z velocity. And we saw this when we were
creating our first game, how we can adjust the height of the velocity that we jumped. We have the amount of air control and all
of these things can be tweaked to create your
perfect character in the game. Maybe you are
looking, for example, a game where the controls
are a bit harder to master. For example, you would set
the air control to be low. That means how much
we can control the character while
they're jumping. Or maybe you want
to create a game similar to Super Mario, for example, where you jump very fast and then you
fall down very fast. And while in the air, you can really maneuver
your character a lot. So you can control the, well, you can increase
the air control. These are all things.
We can also have the character movement
inside of the networking. Not worry about that too much. We have the swimming,
for example, and the flying and
all of those things. So for example, the
rotation settings, how fast we can rotate. All of these things can
really affect your character. If we compile, save, and if we go in here
and select the default, default bond class
to be my character. And you might be thinking, well, this is the default bond class we are putting in a character. Well remember that the
character is actually a palm, which has, these might
be little movements. So the character
derives from the palm. That means we can set
it as the default path. And when we play the
game, There we go. You can see that we are now the character
that we've added, but unfortunately we
don't have any movement. We can move forward, we can look around. So basically, we are
pretty, pretty useless. But this will not last long because I'm
going to issue you a challenge to add the ability to jump in the Event Graph, create an event trigger by
pressing the space bar. It's going to be similar
to the one I think we did the space bar a
couple of videos ago. When pressed, simply
call the jump function, test it out and change the jump, see velocity and
the gravity and see how that affects your jumping. So pause the video right now
and go though the challenge. Welcome back. So in my character, in the event graph, I'm going to delete these
three weeks, don't need them. I'm going to right-click in
here and type in space bar. When pressed. I'm simply going to jump. There we go. Why are we
able to call this jump? Might be because we are
working in a character. If we work, for example,
maybe an A-bomb. Let's see if that will be, if we open up the my bond, I don't think, but
let's test it out. So if we jump, there we go. Okay, so this is not the
jump you are looking for. Let's see the space. As you can see, we
are only calling. So if we jump, there we go. You can see that we don't have this function because
we are inside a part. But while we are
inside of a character, we can actually call this
jumping because look at this, Look what's written in here. This is the target
is the character. This is associated with
the character compile, save, play the game. And now when we hit the
space bar, there we go. We can see that we have
the ability to jump. Now, let's go ahead
and play around. Click on the character
movement, scroll down. For 20. That's a really
nice number to jump on. And we're going to
set it to 600 and maybe increase the gravity too. Compile, save the game. Jump. Up. There we go.
Let's try to have a bit more jumping high ability. If we increase the chunk
velocities and we changed the John velocity or the dye like change it without noticing. Let's put it at ten hundred. Ten hundred, two
hundred will compile. Save, play the game. Boom, there we go. As you can see now we
have this jumping higher, but the, because of the gravity, having a higher scale, we are falling
down to the ground faster if we set it back to one, compile, save, play the game. Now when we jump,
you can see that it takes in a bit more
time to drop down. And I think we're doing
through it the way. I think that's something
really incredible. Why can't I stop this? For I don't know why it wasn't going I can choose
the F8. Let's see. Was that because I was, we used the character
who jumped on top of this cube and we
went flying around. That was a very
nice coincidence. So I hope you
enjoyed this video. I hope you understood
the difference between the regular path and the character which has bit more movement abilities
similar to a human. And I'll see you
in the next video.
40. Player Controller & Inputs: Welcome back, my fellow
game developers. In this video, we
are going to be learning about the
player controller, and we're also going to
be learning about input, axis and Action Mappings. All of these things are in
just a couple of seconds. So let's not waste
any more time. This is a bit of a
longer video, I think. And let's get started. All k layer controller
and inputs. In the context of a
player or NAIA entity, the controller is
essentially the brain. Controllers are non-physical
actors that can possess a palm or any class
derived from a bond, such as the character
to control its actions. There are two types
of controllers. Let's go over them. First of all, we have
the player controller, which is used by human players
to control the bonds and the more complex cases of input and persist
through the game. Why is the bond
can be transient? We'll describe what that
means interested in, but we also have
the AI controller, which implements the
artificial intelligence of a bond, their control. They are more focused
on responding to inputs from the environment
in the game world. It don't really have any
of their own thoughts. That's good. And observe the world around it and make
decision and react accordingly without explicit
inputs from a human player. In this course,
we'll be focusing more on declare controller, or in this introduction at least more on the
player controller. And maybe later
on down the line, we'll talk about the AI. Anyways, back in
the Unreal Engine, let's talk about what I meant when we said player
controller persists. So let's take an example. Let's say we are in a
death match gameplay. You may die and respond. So you would get a new part, but your controller
will still be the same. This example on the
example of a death match, if you've kept your
score on the palm, the score would reset because your palm just died
and you got a new one. But if you kept your score on your player controller,
it would not. This is what I mean by
the word transient. Now it's never a good idea to keep the score on the
player controller. It's better to keep it on
a game mode, for example. That's the whole point. The point I'm trying
to make is that the player controller
is kind of the brain. It's the brain or they
may be soul if you want. Or for example, you can have a player controller to walk
around with your player. And then once you
get into a car, you would use a another
controller for that car. So that's how you can think
of the player controller. Anyways, let's go ahead and
create a player controller. We open this up, right-click in here, create
a new blueprint class. And you can see that we can create a player
controller in here, and we're going to call
it beep the underscore, my player controller. And you can see we have a
controller as the symbol. Open it up. It has a camera, will not worry about that for some reason it has a camera, but there is no camera
and the components sometimes unreal is
just a bit weird, or maybe that's something
I don't understand. Anyways, as you can see, it's a normal blueprint class. Now what do we want to do is we want to go into my character, will remove the inputs
that we have right here. And actually the player
controller in here, we're going to right-click and we're going to
set the jump action. You'll see we have an
action event for jumping. We'll just enter it. Then from here we're
going to try to jump. But as I've said, only the character has
the ability to jump. What we're going to do is
before we actually jump will right-click and get
player character. This will get the
main player character that we have in our
game with the index 0. And since we are, since we don't have any
other character and the world than this will immediately get the
one that we need. And from here, we will drag in. We will write jump. And you'll see that we have
the jump function right here, which is attached to the
target. So there we go. Why does the jump
appear here but did not appear at appeared when we were dragging off
of the data pin, but did not appear when we
were just clicking anywhere. Well, we can make
it appear if we turn off context sensitive. Now if we type in Jump, you'll see that we have this, but we need a target,
not any character. So this is the whole point. Whenever we are dragging out, when we have context-sensitive
and the bands. Or you can see right here at references, a character object. That's why we have the jump. But while pressing around, there's no jump because inside
of the player controller, there is nothing
called the jump. The jump is a function that has already been created beforehand. It's not magic or anything. Okay? Now, this is all good. If we compile, we save, go back into the volume testing. And in here, inside of the player class, player
controller class, instead of the regular
player controller, we are going to use the
my player controller. Okay, no need for compiling. We play the game
and there we go. You can see that
we can now jump. Let's delve a bit deeper and
learn about input mappings. Because now we are faced
with a bit of a problem. What if we have several layers in a game
like a multiplayer game, and each one of them has a
specific player controller. Should we just go and change the code
on each one of them? Should we just go into every single player controller and change declare
controller there? Well, this is where the
input mapping comes in. We'll go into the
project settings. Inside of the input, scroll down until
you find the input. And in here you can see that we have two types of mappings. We have the action mappings
and the access mappings. And if we open them up, you'll see that we already have stuff in here ready
for us to use. Why is that? Because we created this project specifically with
Starter Content. I'm going to set this right
here or we can simply drag it and put it right here
next to the windows. The other tabs I need. What are the action mappings and what are the
access mappings? So the action mappings,
these are map, these are used to map it screamed button
that will later be bound to an event
such as jump, fire. I don't know, kiss
whatever you want. The fact is that pressing or releasing a key
mouse button or key, keypad button directly triggers some kind of game behavior. It's similar to what
we were using when we were testing out
all of our nodes, where we were pressing the
one and releasing the one, pressing the space bar, releasing the space bar, this basically gives us either a true we are pressing or
no, we're not pressing. It's either one or 0. But this is the
difference between the action mapping
and the axis mapping, the access mapping,
which map keyboard controls a keyboard or a
controller or a mouse input. This will later be bound to a continuous game
behaviors such as moment. And you can see it in here. They move forward, move right, turn rate the turn, look up and look down
till the input mark in the access mappings are
continuously pulled. So it's not a 0 or a one. It's a range between 01. And even if they are just reporting that their input
value is currently 0, this still is being
output all the time. This allows for a
smooth transition and the movement or
other game behavior, rather than discrete
advanced triggered, such as in the input mappings. And we'll understand all
of this in just a bit. So how do we add
an action mapping? We simply click, for example, and the access mapping
also obviously the click on the accident action not being in here we are
simply going to say print. So print or say hi. This will be the say hi, There we go. What shall we use? We can either select
a button from here. You can see that we have a lot of options
that we can use. Or we can simply click on this right here and select
one of the buttons. So for example, I'll use the H. There we go. You can see that we can also click on
the Shift Control, Alt and command, which
allow us or make us hold down Shift Control or Alt to make sure
that this one works. Back in the player controller. If I right-click in
here and say type in, say hi, you'll see
that now I have an input action event C, height. So the input action jump is that way because of
the project setting, action mapping says to jump. From here, I'm going
to simply print out a string which is
going to say hello. That's good enough. Compile, save. And now when we play the game, we press the H. There we go. You can see that we
have hello being printed to our screen
with that information. Time for a bit of a challenge. And your challenge is to
adding more access mapping. So add a new action mapping key. If you feel like it, we
already know how it works. Add a new access mapping key, create two events of these two inputs and print
something out of it. Test out each one separately
to make sure they work. And I recommend if you want
to print out something, print out the actual value
of what you are crossing. This will make it a bit more fun as the video right now and go do the shallow bowl case. So I know I left you a bit
in the world of the unknown, especially when I asked you to create something in
the axis mapping, because it's not that easy. I just thought it's time for you to experiment. Sorry for that. Anyways, let's try
to display the name, get the name Gretzky, display name and attach it
right here to the strengths. This will get us a name, then convert this
name to a string. So I'll compile, save. And now when we play the
game instead of hello, we should see that we
are pressing the H key. Very cool. Now, back in the
project settings, if we look up on the lookup, you'll see that we
have the mouse button. Why? I think this is a
pretty good place to stop. I'm going to create
a new axis mapping. Call it the lucky best. I'm going to select the mouse. Instead of right here, I'm going to simply type in mouse y back in New York play. So as you can see now, when we move down, its a value in a certain range, it's not just one or 0, it's a value in between. And you can see it if
you stop moving faster, we get higher values. If we move left and right, you'll see that it stays 0. It's only on the x, y. How cool is that? I hope you enjoyed this video. See you next time.
41. Casting : Welcome back, my fellow
game developers. You might be wondering, why do we have a cube? Why do we have a chair? Because when we play the game, the chair falls on the
cube and nothing happens. But when we walk through the cubes or towards the
cube or fall on the cube, you'll see that it
starts spinning. And this is the whole point
of this casting thing. We're going to
learn how to access specific variables inside
of specific actors. We've casted two, and we'll also learn how
to make sure that only certain characters trigger certain events and
other characters. So let's not waste any more
time and let's get started. Okay, so let's learn about gas tank when using a cast
to note and blueprints. But simply you are
attempting to check if the object that
you're working with, these specific object
that you need. In other words, say
you have created a special character blueprint
cow called my character, just like we did, that has a variable or some sort of custom functionality
within it. You'll need to cast that
specific character. If you want to
access properties on the player character
from another blueprint. Like for example in here, you can always just get the player character node and affect the player character. All of that is good, just
like we did in here. We got the character, the player character, then
we got to jump all as good. But this is only in the general settings and
general ways you cannot access any of the custom
functionalities you have added to my Character Blueprint
that we are working with. Let's see a small example. If I go into my character
here and I create a variable and let's call
it the, hey, whatever. Just create a variable. Compile, save if we go
back and the player character right here and
we tried to get the hay. There is nothing. Try
again to get the hey, there is nothing because
we are unable to get it. But if instead, I display a character cast to
my Character BP, you'll see that we have the
entry point right here. And then we have the either, if it works, we cast from
here, and if it doesn't, we cast from here, and we have the option to
use the BP, my character. From here. I can access
the hake. There we go. So we can set the hay
or we can get the hay, and then we can use any other function to
continue on with the slope. So you can see how
this property or how the casting can be very important by using the get player character than using
the gas to my character node. You can then say if the
player character is my character and then let
it access the variables, functions, the events, the everything that you
would ever meet. Now, why is this
double important? Not only because we can
access certain variables, but because we can also
make sure that we are not affecting the world or the game without
our own knowledge. So what do I mean
by all of that? Let's say we have slowed
down a bit, please. Let's say in here we have, let's remove this blocking or
move it up. Move it a bit. So we'll create little
volume in here that is going to be the trigger. Let's just have a truck
trigger volume in here. And I'm going to just make
it bigger for the sake of everything being a
bit faster. There we go. Now we have this box trigger. I'm going to open up
the Level Blueprint. Right-click in here and add an event on collision
on actor begin overlap. So once we go through the volume trigger
that we've created, we are simply going
to quit the game. Compile, save. And now when we play
the game, we are, we should be using the
third-person character so we can move around. We play the game, we
walk towards the volume, and then there we go. So we stopped the entire game. But what would happen
if, for example, instead of the player
going through this, we have the magic chair. Maybe the magic chair
isn't the best example. Let's see, let's see, let's see or actually know what my test bomb. There we go. We have the bond of testing. And in the details, we'll just simulate
the graphics. Let's see if we play the game. Well, he fall, it won't fall. We need to physics,
physics of k. Actually, let's use
something a bit simpler. I don't want to use the
bond even though the pond would work, but let's see. Let's move this a little bit. Anyways, let's go
ahead and create our own blueprint real
fast will create an actor. We'll call this the
EPA on those score. Fall. Open this up and we'll
simply add a cube in here. And we'll make sure that physics simulate
physics compile, save and the testing I'm
going to drag in this cube. Let's see what happens
when we played the game. The cube falls on top
of the trigger point. The trigger is it triggered, volume is triggered and for some unfortunate reason
we couldn't begin. Now you might be thinking,
Well, of course, while the kube folder, but what if for example, you have some kind of jam that you wanted to
collect and you have a flying enemy around or some kind of platform
that you want to trigger. And once that enemy passes
through that trope, through that platform
or through that jump, he collects the jump for you or heat triggers
the platform 40. Without your knowledge,
how bad would that lock? Your game will just be
working out of nowhere. Using a gas makes sure that only when the player goes
through the, through it. So we can actually
get the other actor. We can cast it to third-person
character on either side. So now only when it
is a third person. So we check for
the third person. If the other character
is the third person, the casting works and we
continue to the quiz game. If it doesn't, it just tells us, let's print out something. Oops. Print out a string which is
going to say, no, sorry, not the third
person. There we go. Compile, save. And now when we play the game, boom, nope, sorry,
not the third person, but if we walk through it, there we go, we stop the game. So you can see the power
of casting of either using functions and variables specific to a certain character, and in order to make sure
that your game runs smoothly. So gasoline is very important. That importance out of the way now it's time to create
a spinning secure. So creating a new actor BP, spinning a cube, you can, if you want to use
the one that we just created for testing, add a static mesh
and make it a cube. Also from thick node
add a add act or low. Locate, that's probably wrong. It's actor Local Rotation and set these z Delta
rotation to, to test it. Now add a branch in-between and promote the condition to
variable that can rotate. Add a box, trigger to the cube, and make two overlap events for the beginning and the
end on each test, the other actor to the BP, my character or wherever
character that you have, maybe it's the third person one that's better
than my character. I just used my player character for any general
character that you have, you might even name
this blueprint something different than me, and set the camera to
true or false or false? False based on if the character overlap
begins or overlap ends. So pause the video right now
and go to the challenge. All k's sore inside
of this right here. We're going to select the trigger volume and
maybe we can convert this. What Let's just delete it. We will not be needing it. Yes. Deleted. And it's telling
us there will be an error because there
is nothing here anymore. Simply delete all of
that, compile, save, close this down and
the cube fall test. Yeah, sure, let's
convert this one. So I'm going to go into the cube fault test.
What did we say? We needed to call
it spinning a cube. Spinning cube, open up. Spending a cube will
move it up a little bit. We'll add a box around it
for the Box Collision. Move it up a bit
more of the physics. I cannot see anything. Can I move this box? Increase it. On either side. We go. Okay, so whenever somebody
crosses these invisible lines, we should start
spinning. So Compile. Save. In the Event Graph, we are going to go
from the event tick. That's what we said. Delete this from
the event thick. We are going to add actor local rotation on these ads will set this
to be to compile save, and let's just trim off the physics on the
cube right here. So physics on the cube, physics, physics
simulate physics. Remove that compile save. So I'm going to move this cube down like this and
move it right here. Now when we play the game, you should see the
cube rotating around. I'm going to go into the
player controller and I'm just simply going to attach this compile save back in
the game or this up a bit. And there we go. So now we
have this cube spinning. Next we're going to go back and spinning cube
in the event that graph and in the neural
create a branch. Notice something, not this. I don't know if we
**** them all this, but let's say I want to add a branch in-between these two. So a bit of a shortcut, you can simply drag over
this wire that is already there and type in branch
or anything else. And you'll notice
that a connection has been immediately made
between these two. So this is a bit of
a shortcut for you. Now we're going to
right-click in here, promote this to a variable
and we'll call this the way this all the time. It's always in the bad place. This condition is going
to be the can't rotate, rotate and compile save. We'll set this to be default
value will be false. Compile save. And then we're going
to get the box. And we're going to
scroll down and create an event with the on Begin over lap
and the overlap. Then we are going from the
other actor we are going to cast to 02:00. Am I writing something wrong? All the other components or gas to third person character. Excellent, There we go. Duplicate that, will do the
same on the end. Begin. There we go. And we're
going to set the counter rotate to true if we begin
overlap and to false. If we stop the
overlap, there we go. This should be it, I think Compile Save. Now we'll play the game. And the cube is still
when we walk towards it, it starts spinning. Excellent. When we walk away, it stops, walk in,
it starts spinning. We walk out, it stops spinning. Now let's try to add some
kind of following cube. Again. Let's just try the magic
chair and see if it falls. Yeah, sure why not?
It's going to be fun. So physics, simulate
physics, play the game. And now when they share
files inside, there we go. It doesn't spin until we the third person player
stands inside of them. So I hope you
enjoyed this video. This is, I believe the last
video in this section. This was a great section. It will allow us to move forward and make our game much better. Thanks so much for watching. If you haven't already, this is the perfect time
to leave me a review. If not, contact me, there anything
wrong, let me know. I will try to enhance
the experience. Thank you so much.
See you next time.
42. Section 8 - CyberSpy 3027 - Creating Our Character - Setting Up Our Character: Welcome back, My favorite
game developers. In this video, we are
going to be setting up our character and our
player controller, and we'll be putting all
the inputs in their place. So congratulations on
making it to section eight. I think at this point we're
about halfway maybe or more. You are one of the very, very few percentage
that make it thus far. So continue ongoing,
continuous smashing doors. I know sometimes it's hard. I know sometimes
it seems too easy, but it's all part
of the process. So let's not waste any more
time, and let's get started. Okay, so finally we are
setting up our own character. This will be a
first-person character because we've already
covered the default bomb, how we can fly around. We've seen how a 3D guy looks. Now we're going to create
a first-person guy view. Before we start.
Obviously, this is the cyber spy 3027 project. And as you can see,
as soon as I opened up the project, I have this one. Now. It's pretty simple. We can just go to
the Content Browser, go to the levels, and just open up level 0. All good. Now, no problem, but there is a problem. We don't want to keep
having to do that step. Well, it's not that bad, but we need to be
more professional. So what we can do
is we can go into the Edit Project
Settings. Right here. If we scroll down until we
find no scrolling down, just the maps and
modes where we can set the Game Mode base
for the entire game. We can also set the editor Startup Map and the
game Default Map. That means whenever
we start playing the game and the
default editor Startup, when we start up the game, instead of the minimum
default level, we are going to
select the level 0. And we'll also select the
game default to be level 0. There we go. So now if we close the Unreal
Engine and open it back up, we should see our level 0. Okay, So I didn't think through the process of
opening and closing just for the sake of
saving a bit of time. So let's get started. Where were we? We are going to talk about the setting up of our
character, right? So first thing first
is we are going to create our character
and the content. I'm going to
right-click in here, create a new folder for the FPS. Character. Fps stands for first-person
shooter or frames per second, but in this case it's
the first-person. And even though we are not
going to be shooting anything, but that's the common
way of calling it. Inside of the folder, we're going to right-click
Blueprint class, and we're going to
create a character. Once the character
has been added, we are going to call it the
BP underscore my character. Or you can call it
whatever you want. We can call it if you have a certain name for your player, for example, a Jimmy. So maybe your, a
characteristic called Jimmy, you can call him bp
underscore Jimmy. So make sure that
you always have BP. So, you know, it's a blueprint. It's not necessarily
this is something that I've been doing
for a very long time. So that's just how our role. Now. We have everything set up in here so we won't be
adding anything too much. You want to add some kind of, I don't know, bubble or something that will
represent the player. That's fine, but we
have everything ready. All that we need to do is maybe move the capsule or know what, let's just keep it as it is. What we are going to do though, is we're going to add
a camera in here. This camera will represent
the eyes of our player and we'll just move it a bit
to the front or to the head. This is basically where the player is going
to be looking. Maybe just move it a
little bit to the front. So imagine this is the skull of the player and this is
where the feet will be. And maybe these are the eyes. Yes, to that. Then we're going
to go in here and we're going to find US
bond control rotation. So if you hover
it, you'll see if this camera component
is placed on a palm, which we are, should it use the view control rotation
of the bond when possible. What does that mean? That
means if we rotate the player, the camera will be rotating. Or in fact, when we rotate
the camera and look around, this will also rotate
the whole body of the player and not
just the camera or something like that. So just check that
n, There we go. So now it's true. Now everything
should be working. So compile, save, and let's
put the character right here. Okay, so now that we
have our character, it's time to create a
bit of input mapping. I'm going to go into the edit and to the
project settings. And then the inputs down here, we are going to create our
action and axis mapping. So as you can see, these are currently
empty because we didn't add any
starter package or we didn't started the game
on a certain template like we did in the
previous project. So I'm going to start off by, first of all, adding the jump. The jump is going to use the
space bar, pretty simple. Then I'm going to
add the sprint. The sprint is going to use
the shift, left shift. And down in the access mapping, I'm going to add one
for the looking down, look up, down that
I say just down. I meant looking up and down. And I'm going to
select the mouse y. There we go. And I'm also going to create the move forward, move forward, backwards, move forward or back. Words. There we go backwards. Is that how it's
written backwards? With an a I'm not the
best that spelling and let's just call
it forward and back. Let's easier. There we go. And what are we going to use? We're going to use
obviously the W. We're going to use the NEP. You might be thinking, how are we going to use the
W and S at the same time? Well, if you look right
here to the right, you'll notice that
we have a scale. We can change the scale. If I increase this,
for example, to do, whenever I press the W key, instead of outputting one, it will output two, meaning we will be faster. What can we do to go back? Instead of using one, we're going to use minus one. Now when we press W
will move forward and when pressing the
S will move backwards. How cool is that,
that information? It's time for a bit
of a challenge for you to finish up
the key mapping. First of all, at the
following mappings, the game pause the look rough, left and right, and the
move left and right. And make sure you set the
proper scaling for each. Stop. The video right now and go do this little bit of challenge. In here. We're going to add
the game pause, and here we go again boss, we are going to or pause game or whenever
you want to call it, you know what, let's
just call it the boss. And then we'll use
whatever you used. We'll use the p.ball and we'll add two more
access mappings. The first one is going to
be the look left, right. We're going to use in
here the the mouse x. There we go. And this one we're going to
call the move left, right. And we're going to use
you guessed it, the a. And the D. The a is actually going
to be the minus one instead of D. Why is that?
Well, let me show you. First of all, this
is everything and whenever we change something
in the project settings, it just gets saved
automatically. You don't need to
press anything. So there we go. Close down the project. So what is the a, the negative? Well, if you look right here, and you can see that when
we're moving to the left, you can see the values
and here being negative. So if we press the a key, we expect to move to the left. That means we are moving left. That's why the a
is the negative. And when moving to the right, that is the positive, maybe you were
confused about that. I know I was 1.5 first. 1 The first I learned
this compile, save the camera
should still be at 0. Excuse me, the camera actually
was in a good position. It'll compile save. Now back in the my character. And the Event Graph will need to actually set up the
player controller. And since we don't have a
clear control controller yet, Let's go ahead and create it. So I'll right-click and the FPS character creating
a new blueprint class, which is under the
player controller, colored VP underscore
my layer controller. I think in the player controller for now we don't need anything. Just compile and save and
back in my character. As soon as we begin play, what we're going to do
is we're just going to get a reference to that
player controller. So now let's go into
the Event Graph and we're going to get a
reference to the character. And this will allow us to just, for some reason, I can
delete the authentic, not worried about that. So we're going to get a reference to the
player character. So get layer character.
There we go. We're going to cast to
my player character. There we go. And after weak acid, I'm going to promote the player
character to a variable. And it's not letting me because I want to promote
it to a variable. So right-click in here,
promote to variable. And by the way, if for some reason you have
this great out, well, what just happened to me? Just simply close this window
down, open and back up. Unreal. Does that sometimes
So underscore my characters. So this is going to be the
main character compile save. And now we'll just be able to use my character and just drag, drag him in here, get from it the reference, and we'll be able
to use the jump, the move and all of
that good stuff. So I hope you
enjoyed this video. Congratulations on
making it this far. You are doing extremely well. See you in the next one.
43. Setting Up Player Controller: Welcome back, my fellow
game developers. In this video, we are going
to be creating our character. So as you can see, we can look around, we can jump, and we can
do lots of other things. So let's not waste any more
time and let's get started. As you can see, we also
turned on the platform. How cool is that? So see you in just a bit. So now that we've set up our character time to set
up our player controller. And even though we've already
set the player controller, now it was the actual time where we will delve deeper
into setting the player. So first we'll be starting to
think of by looking around. So I'm going to go into
the content and to the FPS character and open
up my player controller. From here we have
the reference to my character and we're going
to do a couple of things. First of all, I'm going to get the input x is looking down. So input axis looking up and down and they care of
not using the axis values. We want the axis events. So looking up and
down, there we go. Now we're going to get a
reference to our character. From this character,
we are going to add some controls to look around. But before we do that, there is something that
needs to be explained. If we go back into the level and select any cube that
we have in here, I'm going to make the
details a bit bigger. You'll notice that we
have the rotations, but there's something
we didn't talk about. We didn't talk about the role, the pitch, and the yarn. So let me show you
what all of these are. If we go back into the
slides right here, you will notice that an unreal, instead of using the regular around the
x or around the Y, they actually have
names which are the role, yarn and pitch. And why did they call
these like this? I have no idea because I believe it's a system
for airplanes. So for example, an airplane
is moving forward, a pitch means that its nose
either goes up or down. Roll means, well, role
I think is obvious. If we move around, this axis will roll around and
the yarn is whether we are moving the whole
plane doubts or it's not looking up on
or actually sorry, the arm is if the plane rotates. So the difference
between the role, the yarn, and the pitch, if you've ever played
GTA San Andreas, I believe there is the
controls FOR loop playing. That's a reference. I think most people
will get if you've ever flew a plane in the GTA games. But it's pretty easy. So just think of it. The arm is when we are
looking around this axis, the role is around the x-axis and the pitch is
around the y-axis. And if you ever forget, simply go back into Unreal, just hover over the x. So this is the X rotation. Let me take it back to 0. This is the Y
rotation. There we go. So this is the arm. I mean, sorry, the
y is the pitch even I sometimes
forget what they are. And finally we have the
yarn which is around the great with that information. Now it's time to start
looking up and down. So if we want to
look up and down, what should we be using? Let's look at this. For example. If we want to look up
and down, There we go. You can see that if we move our head up, then move it down. This is very simple explanation, but basically that's
what we mean. My character is going to have
the controller pitch input. And what is the value? The value is going to be the actual axis value and
we are going to be getting it right here from the looking
up event, Compile, Save. Now when we use the
look up and down, which is the mouse phi, I believe so now when
we play the game, are we applying default
palm? Yes, we are. So we'll need to go to
the World settings. We create our game. I don't think we created our game manager
or the game state, whereas the game mode, okay, So we didn't create
our own game mode. Let's go ahead and do that
in the FPS character. Or maybe this is not
the ideal place. Maybe in here is better. Maybe in the platform. Nana, I don't think so. The levels and the enemy. Whereas the best place
we can set this. Well, I think because it's
very related to the player, I think this is the good place. So again, more base, b, p underscore my game mode. Hit Enter. Let's open this baby up. And it's going to
be pretty simple because only the only thing will change in here is the
player controller to BBB underscore micro controller. And the default bond
class is going to be BP underscore my character Compile, Save, and that's it. I guess. That's it. So back in here and the
world settings instead of the game mode
overwrite be none. We're going to set it
to BP, my game mode. So now when we play
the game, there we go. We are this character that
can look up and look down. But notice I'm, I'm sure it's happening through to when
we move the mouse down, we are looking up and when
we move the mouse up, we are looking now. Why is that? Well, because by default and Unreal
everything is inverted. So what we need
to do is to go to the project settings from here and the inputs and
the look up and down. And instead of scale being one, we are going to be
setting it to minus one. That out of the way
back in our game, we should see that
when we play the game, we look up, when we move
the mouse up and we locked down when we
move the mouse down. Excellent. Now the next thing we need to do is we need to set the movement. We're going to set up the
moving forward and backwards. So right here, right next to the looking right-click
and input axes move forward and backwards. I'm going to get my
character in here also. And you can see how important it was to get a reference
to the character. I'm going to add movement input. And we're going to
add this right here. Now. We'll also add the axis value obviously to the scale value. Now there is something
to understand in here, which is the world direction. What direction would we
want to be moving in? While obviously we
would like to be in the plane which
we are looking at. So what do we need to
do is we need to get the actors forward vector. So from the character, I'm going to drag out the
gap actor forward vector. I'm going to set it in
the world direction. What is the forward vector?
It's pretty simple. If we go back to the
viewport of the character, the character, the viewport, you can see that he has this, let me turn off the floor. He has this little arrow
that is in front of him. That's basically when
you are looking forward. This is the actor, while this is the forward. And if you rotate
in this direction, oops, this is not
what we are rotating. Solid capsule. It doesn't rotate. So basically it's the direction that you are always looking. Because we've set
the property on the camera to use form
control rotation. That's it, perfect. Compile, save back
in my controller. Layer controller. What else should we be doing? Oh, okay, so the jumping, Let's see if we get
the input action jump. There we go. We're going
to get from the character, or should we just drag
in a new character? I think we'll just drag
in a new character. And from here we will
simply just get the jump. We've already done this before. We went to the press and we don't need anything,
this will suffice. So Compile, Save, and we didn't test the
movement for some reason, so we play the game. Now if we look up, you look down and if we
press the space bar, we jumped and if we press the w, we are moving forward and
the *** we move back. But obviously we cannot
look left and right and we cannot move
left and right. If I walk around, jump, we are about halfway creating our amazing character and
start moving it around. But the rest is going
to be your challenge. Your challenge is to
finish looking and moving at the input axis
for local left and right. Add the axis, move left and
right axis look axis move. When setting the
movement left and right, make sure we use
the right vector, not the forward vector. Solving right
vector is basically if you take your arm and
set it to the right, that's your right access vector. And also make sure to choose
the correct options for, option for looking inputs. So it's either the yarn or the role I recommend
that you try and do it yourself instead of just testing both health and
see which one works. Because it would be a
great lesson for you. So pause the video right now
and go do the challenge. Okay, welcome back. So we were still
playing the game. So what should we use
is the pitch I mean, sorry, we've already
used the pitch as the arm or is it the role? Well, if we select this, for example, let's try the role. I don't think our player
would like looking like that. Most probably. This is how his head is
going to be looking. Great. So back in my player character
when we look in here, okay, so look up and down. Let's add the input action. Look left and right. And from here we are to
drag and the controller. Y'all. Y'all actually, sorry,
I was pronouncing it. Y'all. Almost like a compile, save, and play the game. Look left, look right. And now we have full
motion of our looking. How cool is that? Now, the last thing we need to do is set up the
proper movement. From here we're going to add
the move left and right. It's the axis event. We're going to add
movement input. Okay, and that's,
I forgot about it. So add movement input. As you can see, it's starting
to get pretty ugly in here. I don't know how we can fix it. Just a bit more organization.
So there we go. I think it's inevitable in here. And I'm going to get the
get actor right vector, set it up right here and get the axis values. So there we go. Does it look a bit bad? Yes, it does. Can we do anything
about it? Yeah. Maybe let's just move this right here and
make it more aligned. As I told you, it's
always very important to have well-organized
everything. Because someday you
will come back to this. I'll move this right here, add a comment by
clicking C and call this the movement meant. And maybe we can add the
jumping into the movement also. I'll make this a bit bigger. There we go. And this will be around compile, save. Play the game. Okay, so we started off
in the wrong place. That started in
here, play the game. Okay, so now we
have full control. We can look around, we can jump, we can jump
from platform to platform. But as you can see, some of the controls aren't as good as we would
like them to be. In the next video. Almost made it into
the next video. We are going to be adjusting our movement for the player and customizing it the
way you would like. Thanks so much for watching. See you in the next video.
44. Adjusting Player Movement: Welcome back, My favorite
game developers. In this video, we'll be
adjusting our movement. As you can see, the jumping and moving as are a bit different. And we'll also add the
ability to sprint. So as you can see,
I'm now much faster. And finally we add the ability
to pause. As you can see. You can, you might think that online too and not
moving at all, but we actually have false. And if I try to walk
and look around, I can. So let's not waste
any more time. And let's get started. Okay, so right now
when we play the game, our character moves around, our character jumps, our character looks around
and everything is good. We have all the abilities
to explore the world, but there is still something. First of all, I
don't like this way, v jumpy thinky I want to have
more of a platform or fear, like feel like
supermodel or something. So I'm going to be adjusting
my character's movement. And before I start doing that, I just want you to
know that I've already played through these and I
already know what I want. So what I recommend
that you should do is that you take the time to adjust those values on your own and see what works for you, what doesn't work for you. Maybe your map is a bit smaller, maybe your map is a bit bigger. So it really depends on your play style and how you
want your game to feel. This is the part where you add your own creativity into
it and really make it, make it your own. So the gravity
scale, the gravity, I'm going to set it to 2.8
because I don't want to have this float thing and then take a couple of seconds
to go down to the ground. I wanted to be like PPP. I meant how I mean, next we need the
max acceleration. This means that it will take us time to get to the
maximum speed. I don't want that. I'm
going to set this to ten K. That means it doesn't mean
that we are this fast. It means that we get to our
maximum velocity very fast. And obviously we can change
the mass velocity later on. Now if we scroll down, I also want to change
the jump Z obviously because now with
the gravity to 0.8, I don't think will be even able, even able to lift
from the ground. I'll set this to 900. And the air control, I want to have much
more air control because while jumping from
platform to platform, I want to be able to arrive at that platform
because the gravity is 2.8, so we're falling
very fast or we need a bit more ability
to move in the air. So I'm going to compile, save. And if we play the game. So now when I move, I immediately get to top speed. When I jump, there we go. Did you see how that jump looks? This is what I'm looking for. I want to have this nice,
clean supermodel star. So when we jump, we can
also move in the air. So when we jumped like this, we have full air control. You can see how we are
slamming down to the ground. How cool are these cubes
in the year really gives our world and field. The world is huge and we're just a small little
part of it right here. Anyways, let's
continue what we still need to do a couple
of things and one of them is adding the pause. If you remember in
the project settings, the input we've added, the sprint and deposits. So let's go ahead and
finish up with those. Back in my player
controller in here. Are we going to do while we're going to be
setting the pause? So I'm going to create the
input action for the pause. Action event for
the pause is human. And what I'm going to do is instead of just
setting the pause, we need to make sure that
we can unpause the game. Also, if you're
playing and you pause, you then need to have some
kind of way to unpause it. From here, I'm going
to create a branch. And this branch will have a
condition on it that will check, is game false? This is simply returns
true if the game is paused and false if the
game is not paused. If it's true, if
the game is paused, then we are going to unpause it. So we're going to
set game paused. And it's going to be not paused, as you can see right here. And then we're going
to set game bars. If the game is not paused. Before we move on, there's
something that we need to do. And if we click on
the bars right here, you'll notice that we have in the inputs something called
the execute when pulse. And this is very important. We need to make sure
that we check it. Why? Because this will, if it's not true, if it's false right
here, execute. When paused will not work. That means while we are caused, this event will not execute, which really hurts us because we will not be able
to unpause it. Because once it's paused, How are we going to make
sure that we un-pause it? That's the brainiac
Compile Save. Now when we play the game. The problem is that we
don't have a player start. So if we add a player
started in here, let me go to the Create. Let's start. We add it there,
start like this. Let's draw data into
the proper direction. There we go. And I think now we should start from the players
thought, Okay, great, so now we move around and
if we hit the peaky regard, you can see that everything
has stopped, even the lights. Now if we hit the P key again, there we go, we can
then move around. Let's test this out
with something, with something that is
moving in the environment. So you can see that this
platform moves once we had the peaky,
everything stops. Excellent, So we have
the buzzing working. The next thing we need to
do is set up the sprinting. And the sprinting is going to
be part of your challenge. May look layers print
the input sprint action event acts as the Character Movement
Component on the character. So why are we doing this? Let me show you. Because if we look in
the Unreal Engine, if we look on the character, the sprinting isn't
on the character. So whenever we were trying to
access the jump, the role, the everything, these were
all part of the character. But when we want to access
specific movements, we need to access the
Character Movement Component on our character that we
have. A reference of. X is the movement component
on the character. When pressed, set the max walk speed to one hundred ten
hundred when released, set it back to 600 and
also obviously tested out. So pause the video right now. Go do the challenge. Okay, welcome back. So back in my platform where my mouse is
starting to get old, let's select these and call them the pausing game or game pause, pausing game as
the same worries. In here, we're going
to right-click. My right-click is not
working very well. I'm going to add the
action Sprint advance. From here. I'm going to get my
character, my character. We're going to access
the counter movement, get character
movement. There we go. Let's set it right here. From the character movement
we are going to set max, walk, speed. There we go. The pressed. And then from here,
you know what, let's just duplicate
this sort of Control W, when released. The character movements
or what should be the max walk
speed when pressed, it should be one
hundred, ten hundred released, it should be 600. And maybe we can even
increase the suburbs or maybe we'll make
it 1000 to a 100, so it's double the speed. Compile, save, play the game. So now we walk around and
when we hit the shift key, regard, you can see that we are much faster than I
think we're too fast. Ban them all. My god. This game is becoming
really, really nice salt. For some reason I always
start right here. I hope you enjoyed this
video and the next one, we are going to be making
our movement a bit more realistic by adding some
camera shakes and Unreal. Let's not waste any more time. No, that's not the right word. I'll see you in the next one. That's the proper one.
45. Camera Shake in Unreal : Welcome back, My favorite
game developers. In this video, we'll
be adding a camera, shake our heads while we
are moving, as you can see, making our little game
a bit more realistic. So I know this video is long. This is the last video
of this section. I believe there will be many things that we
need to explain, many things that we
need to understand. That's why I go over things a couple of time just
to make sure and explain as much details
as I can to make sure that you fully
understand what we're doing. So let's not waste any more
time and let's get started. Okay, so time to make our movement a bit more realistic by adding
a camera shake. About not only a
camera, camera shake. The camera shake is
going to represent our head moving up and
down when we are walking. And maybe be a bit more faster
when we're walking faster. But let's first of all just
handle the camera shaking. So in order to create
a camera shake, we need to go into
the FPS character. Right-click in here, create a new blueprint and
choose all classes. And in here we're
going to search for my camera shake and we're going to use martin
camera shake. Why is it called MATIN? Be honest, I still I've never asked that question only
now that I think of it. Anyways, the MATIN camera shake, that represents
the camera shake, I'm going to call
it VP underscore. While shaking. Shaking or head
bobbing or wherever. Block shaking can
see the symbol. Double-click to open it up and
let's just add it in here. The game is still running, so I'm going to stop it. And as you can see, it's very similar to all the
other blueprint, the graphs, except for the options that we have
here for the details. And this is where all the
magic is going to happen. So what we're going to
do is we're going to set each one of these keep in mind I already know what I want. I've been through these. You can set whatever you want an experiment and add
your own flavor to it. But for now, let's
first of all talking about the oscillation duration. This is the duration in seconds in which we will
keep shaking as we move. And we're going to set this to as much as we possibly can. Why is this? Because the
way our camera shake is going to work is
if we're walking, then we will be shaking, will just be moving
our head around. And if, for example, we walk for, let's say we
have this ten seconds. If we walk for ten seconds, then this camera shake
is going to stop. And we don't want that. We want to make
sure that we have enough time of camera shake. So for example, if it's
59 thousand seconds, if we walk more than
5,959 thousand seconds, then we will stop
the camera shake and hopefully we won't have
to walk that much. Next we have the
oscillation blend time. So this is between
us not moving at all and then suddenly
having a camera shake, we would like to have a bit
of blend time and an out. And the out means that
while we are shaking, then we stop the shaking. We also don't want it
to be very abrupt. We wanted to slowly move
down and slowly move up. Next we have the
actual oscillations, so we have the rotation location and the F or V. So first of all, let's talk about the rotation. You can see that we
can add to the *****, to the Y'all and to the role, but we won't be adding any
rotations on the roll, on the rotations because I
think and I actually try that. It really adds a
bit of dizziness, sand layers or some
users of your game. So let's just keep away
from any rotation. Next, let's talk about
the location oscillation. This is what we are
going to be adding. So I will open up the x, Y, and Z, and you'll notice that they all have similar options. So we have amplitude, frequency, initial
offset, and the waveform. Let's talk about the
amplitude and frequency by showing you a
couple of slides. One slide actually. So if you don't
know what amplitude and the frequency are, you'll see that amplitude is the amount in
which you shake. So if we set a high
amplitude than our head movement is going to be very high and then very low. If we set this, set it
to a small amplitude, we will have a small moving
head and then small moving. Now, what's the amount
in which we are moving? You can see the top
and the bottom. And then we have the
frequency. While walking. Do we have a lot of head
bobbing or do we have a bit of a head bobbing or as
the head bobbing very slow. This is what the amplitude
and the frequency are. And you can play around
with these to make sure that they are
to your taste. Back in here, next we have the initial offset
and you can see that we can either choose
random or we can choose 0. So if we choose random, we can either start by looking
up or by looking down. But if we choose random of that, I say random before we choose 0, it will depend on the amplitude. So if I set it to minus three, minus three, for example. Then we are going to start from the bottom
and then move up. If I started last three, then we are going to
start from the top and then move to the bottom.
That's if it's 0. And then if it's random, it just starts no matter what the value or the sign
of the amplitude is. And finally, the waveform, we have two waveforms. We have the sine wave, which is similar to
this one right here. You can see that they
are very consistent. But actually this is not
similar to a sine wave because sinewaves have a
consistent amplitude. In this case it's not. But the box you get the points. So it's a small
moving up and then as smooth moving down and
very consistent movement. Then we have the Perlin noise, which is all over the place. Usually the Perlin noise
is used better for a camera shake with
explosions in itself. There's an explosion or
you get hurt or something, then you can use
the Perlin noise in order to create this
shaking effect. But for now, we'll
stick to the sine wave. In any case, we're not going to add any movement on the x. Because if we look at the
character, for example, this camera, we don't want
any movement like this. We only want or
movement on the x-axis. Only want movement on the up. And the what happened on the, on the z axis and the y-axis. So there we go. I think I must have
messed this up. I don't know, to be honest. Anyways, let's not
worry about that compiled safe back in here. On the y-axis, on the amplitude, I'm going to set it to five. The frequency will be seven. We will have random offset, we don't mind and we will
keep it as a sine wave. Then on the z-axis we're
going to have five amplitude, 15 for the frequency and
keep the initial officer. Let's set that to 0 just
to have a bit of variety. Finally, let's talk about
the F or V oscillation. It's pretty much similar. You can see that we have the
same properties in here. The only difference is as we
change the field of view, which we already understood, which is the field
of view either you zoom in a bit
and zoom out a bit. This is not very useful
whenever we are walking. Maybe it could be useful
if we are sprinting, that would be really nice. So you can just have
a bit of zoom in. That would be amazing. I think so. Or maybe you can
add a bit of oscillation. I will recommend that
our fovea oscillation, but in our case we'll
just leave it at that. And finally, we have other options that
you can delve into, but we're not going to it too
much about that right now. With that out of the
way, Compile, Save. Now it's time to
actually add that camera shaking into our
player controller. First of all, we're
going to create two new custom events. We right-click in here
and add custom event. And we're going to call this
the Stuart camera shake. And from here I'm going to get
the player camera manager. So get their camera manager. Yes, this is new, I know, but this is
something that we need. And then we're going to
start camera, shake. The camera shake as you
can see right here, we can select which
camera shake we want. If we click on here,
we can see that we have our PPE walk. Shaking. There we go. Let's
connect it right here. And then we are going to
stop the camera shakes. So we are going to use this
actual camera right here. So stop camera shake and will not use this
one because obviously we don't want to start the camera
shake and then stop it. We are going to use or actually create a
new custom event. And whenever you are
creating a custom event, a handy shortcut is type in dot and you'll get your
custom event scarp. Camera. Shake. There we go. Why are we using let me
just move this up it, but actually set it. Why are we using
this actual value? Well, because when we
start a camera shake, we are sort of instantiating if you want this
camera shake glass. So we want to actually stop
this camera shake class. We don't want to stop
some random shapes. We want to stop the one
that we have started. Now that we are
stopping and moving, a stopping and starting
the camera shake. The next thing to do is to go down to where we are moving. And from here, we're going to create a couple of branches. We're going to set a branch. Here. We are going to connect
both movements for the left and right and for the
forward and backwards. And we are going to create a
very big condition in here. So we're going to get
the player character. We are going to get a
velocity. Velocity. There we go. Now that we have the
speed of our player, I'm going to split the
structure and to x, y, and z. And we are going to
check if our x-axis. Is greater than a
certain amount. So if it's greater than, let's say 15 will also
check if it's less than 50. Why are we checking both ways? Why are we checking that
it's less than minus 50? And why are we checking
that it's greater than 50? Well, because if we're
moving forwards, after we get to
that speed of 50, we'll get to a speed of 600. So this really is
just a formality. It can just set
it bigger than 0, but 50 is like, I don't know, maybe you want to add
some crouch movement. In that case, you don't
want to have camera shake. It really depends on you. So if we're moving forwards, hours of velocity
will be plus 50. If we're moving backwards, our velocity will be minus 50. The same applies if we're
moving left and right. We'll check on the x, will also check on the y, but we will not check on the
Z because we don't want to have any movement if we are jumping or
something like that. Greater or less
everything is good. Now we're going to check
if any of these is true. So I am going to use the OR. So if any of these is true, then we are going to set the
condition right ear to work. And what does the
author mean OR means either this one or this one, or this one or this one. If one of them is true, then we are going
to return true. So we get the character, after we start the movement, we get the branch. We check if our character has a velocity on the X or the Y greater than 50
or less than minus 50. If only one of them is true, then we are going to start. Actually, you know what? I'm going to leave this
to you as a challenge. I remember this at the
last second chi-square. Start the camera shake when we have movement and stop
at when we don't. Make sure we only do this once. We don't want to
have camera shake on top of a camera shake. You can try it without the
ones see how that works out. Also, make sure that after we
start and stop the shaking, we reset the do once on each other and test it out
to make sure it works. So after we stopped
the camera shake, we need to reset
the ones that was behind the stock camera shake. After we started
the camera shake, we reset the ones of the stock camera
shake and vice versa. So pause the video right now
and go do the challenge. If it's true, I'm going
to do once after this, do once I'm going to start camera shake,
the better we go. Then if it's not true, that means we're not
moving fast enough. I'm going to stop. Camera. Shake. There we go. Now what we'll do is we're going to find the
stop camera shake, reset the start camera shake. And from the start camera
shake we are going to reset the ones of the
stock camera shake. Why are we doing this? Well, after we stop, we want to then
have the ability to again do this once, once again. Once we stop, we want to
again be able to start. And once we start, we also want to
reset the ones of the stock camera in
order to do it again. So Compile, Save, it's
giving me an error. If we click on the target, we have a problem in here. First of all, we need to remove this immediately, compile, save. The problem is we don't have full read on here is not
a blur camera manager. Therefore, target must have
a connection for case. So since that's the case, let's just attach
this one right here. Drag it down. Okay, so Compile, Save seems everything is looking good
when we play the game. Let's see, We'll look
around once we start moving. There you go. And as you can see, we have our head bombing, a bit of lagging on the
game, not know why, but as you can see, we have this shaking
of the camera. Once we stop, there we go. There's no more head bobbing. When we move, we have
the head bobbing again. And when we sprint, we also have the head bobbing. Okay, great. So thanks
so much for watching. I know this video has been long and I'll see
you in the next one. Congratulations on
finishing this section. We'll give yourself
a pat on the back.
46. Section 9 - Physics Collision - Adding Collisions: Welcome back, My favorite
game developers. In this video, we are going
to learn about collisions. We've already seen
how collisions work and Unreal button
now it's actually time to delve deeper and really understand
what's going on. Now you can see this
table in the air. You can see this ramp. If we play the
game, There you go. You can see that
our table does not behave as a table adult. And we are going to see how we did that and why we did that, and how we can then
turn this table back into functioning
like a normal table. Let's not waste any more
time and let's get started. Okay, so now it's time to
learn about adding collision. That's first of all, create a new level. And we'll simply just duplicate
the BP testing maybe, or BP testing is a
good one to duplicate. So Control W. And we'll call this
the collision testing, coalition testing. That's open this up. Save. Okay, great. Let's delete the share for now. Yeah, we don't need it. Well, the lead this also and I think in the blueprints
we have a lot of stuff. I'll just select all of these
and simply delete them, compile save, don't
worry about this. It's only deleted this script. Close this down. Now let's learn
about collisions. First of all, if
we play the game, we are the default palm. Okay, great. I am going to move the
player a bit backwards. The players thought
where the player starts, I'm going to create a
cube to represent a ramp. So let's add in a cube. Let's make it a bit
bigger like this. Actually, let's make
it bigger like this. On this side, also, also k. So there we go. This
is our makeshift ramp, so simply a very basic,
very, Nothing Grand. Then we are going to
add a table on here. So in the content, let's search for table. We'll add a table. We're going to go into the details and simulate
physics on this table. So now when we play the game, you'll notice that the table
falls and there we go. You can see how it behaves
the way that it falls. And actually let me just move the player this angle
and just rotate them. So now when we play the game, we can see the
table falling down. As you can see every
single time we have a different way of
the table following, but it's always pretty
much consistent. It behaves as a table, but I don't know if you've
noticed when it was falling, it wasn't quite like look
at the edges when it falls. It's not actually like a table. You can feel it right here. You can see that there is kind of a weird way that
this table is behaving. It's as if it's floating
a bit in the air. And this is what we are going
to learn in this video, how the collision is
working on these tables. If we go back in here, we can double-click
on this Static Mesh. This is called the
static mash editor. This is where we can do lots of things to the static mesh, but also change up the
collisions that we have on the table or any other static mesh
for that matter. First of all, we need to
understand that we have two kinds of collisions. We have the simple
collision, as you can see. Now you understand why we
had these different places where we didn't touch the
floor just had a fluffy thing. And we also have the
complex collisions, as you can see that engulf
the whole part of the table. And the complex collision and simple collisions
are used based on what the Unreal Engine fields as needed or what you
determine as needed. So if you, for example, one of the stable to be
super accurate and you want, for example, to shoot
a boat and have it go through these
spaces, for example, you'd obviously use the
very complex collision if you don't care and you just want to have a simple
table that you can put stuff on and you really
don't care what happens if, for example, the table falls, then you can use the
simple collision. Now you might be wondering, why would I use a simple collision at all if I have the
complex collision? Well, because whenever you are using the complex collision, it's much, much more taxing
and expensive on the system. Whenever you add a
simple collision, it's very easy for the physics
engine in the unreal to understand what you
need and how is added. Now that we know that, how, now that we know how the complex collisions
and simple collisions look. I'm going to turn off
the complex collisions, but because we'll focus
on the simple ones, right here, you can see
that we have the collision. We can click on that and we can remove the collisions
completely. Now if we go back in our
game and we hit Play, you can see that
the table no longer interacts with the
world around it. We don't want that,
we want to fix it. So let's add our own
types of collisions. First of all, you
can see that we have these simplified
collisions. I'll leave that for later on. Next we have the ten dope. Now, we'll talk about
these in just a bit. But first of all,
we need to talk about the auto
convex collisions. And as you can see, as
soon as I click on that, I have a little window
that opens up in here. We will take a look at using the auto convex
collision tools to automatically create collisions
for static measures. As you solve. As soon
as we open it up, we got the option here. And inside of the auto
convex collision, we have the option to set
all of these parameters. Now, I'm not fully sure
how these parameters work. This is something very
deep and complex. All that you need
to know is if we hit the apply on the
already default values, it creates this nice collision. And you can see
it's a bit better than the one we were
using before hand. Better depends on what your
needs are in the game. So right now if
we play the game, notice that the
table is much more interact with the world
and feels much, much more. How should I call it real? So it's a physical object because of the way
these are handled. Now, you can play around
with these values, increase the hop
count, for example, increase the vertices, increase the whole
precision, and apply. All of these will affect
how the condition of wraps around
this complex shape. As you can see when we
increase the precision, there are no longer
lines in here and it's more into the actual table. Now, this might seem very cool, but as we've said, This is closer to
complex collisions, which makes the table
much more taxing on the system and requires
a lot more calculations. This is the Convex,
Convex decomposition. Whenever it's called a for
me, I've always known it, always known it as the
auto convex collision. I'm going to close that down. I'm going to remove
the collision. Now let's talk about these
gain DHAP thing is right here. So basically, whenever
you add one of these, you create a simplified
collision based on the number of dots adopts is a type of
bounding value volume, which stands for K discrete
oriented poly types, where k is the number
of axis aligned planes. What do I mean by all of that? Basically, it just creates
a type of wrapping around. So as you can see, we've
created this kind of shape. It's not a very simple
shape as an a squared, but it is still very simple. Noticed we used, we
have the ten dot x, the y, and the z. And each one of these is
based on what she required. First of all, for example, when we add this
one and this is on the k dot x and you want
multi-story much difference, but it's because the
table is circular, but usually this is more
focused on the x axis. If we, for example, let's remove this collision. If we add the y-axis, this will be more, well said the y as a more
priority for the table. Let's remove this. And if we set the z, you'll notice that it's more
focused on design. Now, this is where it really shines because of the
difference between the x, because this table is circular. So the Y and the X really don't have any
difference between them. But for example, when
we talk about the SAT, you'll notice how much more
focused on the z axis, which is the height of
the table. It is really. So that's basically
the x, y, and z, which basically
creates poly types, which are these rectangles and triangles around any
object that you have. And it's really simple. It's like as you can see, this table can be really enough. If you just want
a standing table. Obviously when it falls, you can start seeing
the differences, but if you just need something that stands and
things to put on it, it will be perfect and much
less taxing than using, for example, the auto convex
or any complex collision. Let's remove this and let's
see the rest of these. So we have 18 DOP
simplified collision. As you can see, it's similar. It's like a
combination of the x, y, and z was more polytopes. Obviously much more
calculations will remove this. And finally, we'll
add the 26th DOP. As you can see, this is the most simple and accurate
and I believe this is what we were using for the table before we removed it. So I think this was
the standard one, if I'm not mistaken. So if we save and replay
the game, There you go. You can see how the
table falls down very, not extremely naturally, not as, as you'd expect a
table like to really, really fall in real life, but it's very close
enough in my opinion, and it really depends on the
object that you want to use. Now, with all of
that out of the way, I'm going to issue a
challenge to test out these simple collisions
that we haven't yet tested. Add the various
simple collisions that we have with each one. Try dropping the
object on the slope, see how it slides down, and see which one
fits the table most, and use that if you want also, I didn't add it in
here in the challenge. If you want to go grab
a chair and try to apply all of these to then
share also, see how it works. See what you like and how
you want your game to see which way it's better to use a chair and a table
and all of that good stuff. The simple collisions
are if you click on the collisions and
the static mash editor, they are the first
three, the cube, the capsule, and the
sphere, I think. Pause the video right now
and go to the challenge. Okay, welcome back. So I'm going to go into stable. I'm going to remove
the collision and I'm going to add
a sphere collision. And look how funny
this is going to be. Right now our table is not
behaving as a table at all. Now if we go back to the static mash editor and then we select
a box, for example. Now this should be really, really accurate
because there we go. It's like it's sort of a table. It's not really table, but it kind of does the job. So in my opinion, if we'd ever want to use like
notice also the difference between the very simple
collisions and the holotype. So you can see how we
have inside of here. These are the poly types. These are the like the lines that are added in order to
make things more accurate. Finally, the last thing that we need to
say in this video, like what would you
use in this case? My opinion, I would not use
an auto convex collision. It's too taxing for
a simple table. I'm not going to shoot through it and don't think
I will need that. My opinion most
probably I'll use the z or if I feel that the
table is going to fall down, I would use the 26th dots. So that's just that. I think This is
the best solution. If we play the game. There you go. You can
see how the table falls. Thanks so much for watching. Well, obviously in this case you will not use the gate off, but thanks so much for watching. I hope you enjoyed the
video and I'll see you. The next one.
47. Collision Response Reference : Welcome back, My favorite
game developers. In this video, we are
going to be learning about collision response reference
in a very long video. So what happens in here
when we play the game, you'll see everything is normal. The ball just bounces
off of the cube. But if we go into the scripts
and we connect these two, recompile, and we
play the game at heads and then it overlaps it. This is going to be a
very crucial part of this video to really understand
how collisions work. Bookshop concentration capsule. And let's not waste
any more time, and let's get started. All k. So now that we
understood how collisions work, it's time to understand how
collision responses work. And we've already used
these many times when we are using the Add
Trigger Enter for example, this was one of the
collision responses, but let's see what other
collision responses we have. First of all, we have
the collision where we are having objects
interact with each other. So for example, the one that
table falls on the ramp, this is an interaction when our default bond hits the floor and doesn't
move through it, this is an interaction. Then we have the hit events. If you want something to
report as it has collided, a blueprint or section of
the code can be triggered. For example, when the table was falling to the ground,
nothing was happening. We are just basically looking
at a physical object, just hitting another
physical object. But when you have a hit event, you will be able to
see an actual event being triggered and some part of your code being called for. And this is very important
as we will see later on. Next we have the
overlap and ignore. So two objects overlap
but nothing is reported basically to
object ignore themselves. So you've got a ball, you've got another wall. They hit each other
but nothing happens. They just path, pass
through each other. And finally, we have the overlap and generate
overlap advantage. We've seen how
this works before. So unlike the collision
that can fire every frame, the overlap events are receive, an received, begin and receive, and overlap, which only fire
in those specific cases. So in the event of a hit, you'll see that when we
collide two objects, the hip keeps on giving
until or while we are hitting on the overlap
it just because at once on the beginning
and then on the end. So let's see how all of
that works in our game. Bag and the Unreal Engine. I'm going to stop this
table from falling by removing simulate
physics and just skip it right there in the air. Let's move the player a bit. And I'm going to
reset the position and the angle and
move it up a bit. And let's see, where
should we be putting it? Let's look in that direction. There we go. Now I'm going to create
a new shape in here, which is going to be the skew. And for some reason
my mouse button, I've already negative of
this haven't thought. So. I'm going to add this
little cube right here. The goal is going to be
in front of the player. And then I'm going to add
a sphere over that cube, move it up a bit, and let's simulate
physics on this. Now when we play the
game, There you go. You can see that the cube
normally falls on this. I mean, the sphere
falls on this cube. They interact with each other. Nothing too fancy about that. Now, let's go ahead and
convert this sphere blueprint into a BP underscore sphere. Select regard. We're not going to
change anything in here. We are going to go
into the Event Graph, will simply delete all of this. Now, if we go back
into the testing, you'll notice that if we scroll
down into the collisions, we have this option
right here to simulate and generate
a hit advanced. This is very important
for us later on. We also have the
generate overlap event, and we also have another
thing that is very important. Obviously we have other things, but the next thing that's very important is the
collision preset. And you'll notice that all of, all of our objects right here have this collision, a preset. For example, this cube
has a preset of default. Now you might be thinking, why is the cube and
the sphere different? Well, the sphere
and the cube where the same until I simulated
physics on the sphere, and then it became
a physics actor. Instead of the presets
of the default. What is even the presets? If you look right here, you'll see that on the
default we can select custom. Once custom is selected, we have all of these options that we
can play around with. Now once you change it from
where is it, where did it go? Okay, so on the collisions
that let me make this bigger and expand this. Expand the details. The physics actor. Once you have the physics actor, you'll notice we have these
predetermined collisions. If we change from
physics actor to block all dynamics,
it's the same. Let me try to overlap
all dynamics. There you go. You can see that now we
are overlapping things. Now, let's take a
quick look and look through all of these
just very simply. First of all, we
have the default. This is the default settings
for any static mesh actor, but keep in mind
this will not move. Next we have the custom
which allows us to customize how it interacts
with every single object. And you might be looking at the responses and
object responses, don't worry, we will
talk about that. Next. We have the no collision obviously doesn't
collide with anything. You can see that it ignores almost everything but
ignores the collision, the trace responses but
blocks every other object. Then we have the block all
which blocks all object, the overlap, all which
overlaps all the objects. Now keep in mind we
are blocking all and overlapping all static
meshes or static world objects when
it comes to block all dynamics who are blocking
all of the world dynamics. And you'll notice that they
are basically the same. But you can see right here
that the object type is changing and we'll get to the
object type in just a bit. Overlap all dynamics
ignore only pounds. This is basically, I believe, the way our bond. If you have a bond
that is moving, you just ignore it
if he hits you. This is good, for example, for an enemy that you
don't want to interact with like our flying ball
might be a good solution. We have the overlap only ponds, so we overlap only the bonds
and some physical objects. And the vehicle, for example, because a vehicle
usually as a palm because it's if a vehicle
is rarely standing, it's either a static
object or it has to be used by either the player
or some kind of AI. Next we have the ponds. So this is a way are
a bomb might work. Character mesh, physical
act of distractible. And you can see that
all of these are just presets for our game. Once me select one of these, we will have a set of these various responses to different objects and
elements in our game. Now, let's talk about
the Collision Enabled. We have four options in here. In the no collision, the query which is north, which is used for spatial
queries such as the overlaps. We have the physics only, the body is only used
for physics simulation. And finally, we have the
collision that is both for the query for spatial queries
and for the physics only. Usually it depends on what
you want your object to be. You just wanted to
overlap with things, or do you just want it
to be a physical body? You can want to have them both. Next, we have the object type. So let's say for example,
this is customer. If we select the floor in
here and we set it to custom, will make IT world static. And this cube right
here is going to be, Let's call it the physics body. Next we'll select this
view and we'll say that we want to make it. Let's just keep it as a bomb. That's okay. Let's say we scroll down
in here and we say we want to block world dynamic, but we want to overlap
the physics body. So keep in mind this cube
is the physics body. This floor is the word static. So now when we play the game, the queue for the sphere
falls through the queue, but then hits the
floor and stops. This is very important to understand and this is how this, all of this works. You can select the object type of any object that you have. And this will change how it, how it interacts with
other object types. So there you go, you can
select one of these. Next we have the collision
responsible responses, either the ignore,
overlap or blog. And keep in mind the difference between the overlap
and you ignore. Ignore might look
similar to the overlap, but there is a big difference when overlap actually can or has the ability to generate some kind of event
sold all the time. The Unreal Engine
is listening to an event over the world. This object interacts with something that it
needs to overlap. Next, we have the
trace responses. So choice responses are
usually used for a re-cast. And what are, what are re-cast? They are basically
lasers that you can shoot out from certain position, not liberal lasers
like red ones. No, it's simply a
invisible laser that you can shoot from. Usually this is
used, for example, for when a player is aiming in a first-person
shooter game. So he aims to a
certain position. And then when he shoots, a re-cast is created
a new determine whether that object should
be metal or whatever, or think that bullet
towards that direction. So basically this
determines how the re-cast. As being said, will not
delve too deep into that. And finally, we have
the object responses. Obviously, this is the type of objects that we are
interacting with. Now, with all of
that out of the way, let us demonstrate how an
event hit two would work. If we right-click in here. And let's compile. If we select these static, scroll down and open, open this up in here, you'll see that there are
common things that we see. We're going to, for example,
use the n-component. It, we can from
this n-component, simply print out a
string which is going to say hello, compile, save. And when we play
the game Volcanoes, nothing happens because we are going to have to
select this or select this one and simulate
hit events and select the sphere and make sure
it's simulated events. Then when we replay,
there we go. You can see that this
keeps on giving. But while the obviously it
stops at a certain point, but if we create an
overlap, begin overlap. Then we print out, for example, a red hello. Just to see the difference. Compile, save, and make
sure that we generate overlap events on both
the cube and the sphere. Now when we play the game, we get one hello. But then once we bounced, I think when we bounced, we then touched it again. Yeah. So you'll get
to hellos because we only send one when we
overlap with that, with all of that information. Now it's time for a
bit of a challenge. Your challenge is going to
be to change the preset. So after hitting, change the collision responses of the other component to
overlap on this feed. Back in here. This is going to
be a tricky one, even I sometimes don't
know what's going on. We're going to make
sure that this sphere, sorry, this sphere
blocks everything. You can set it to
whatever you want. No, not worth static because
it needs to be moving. So physics body, right
now when we play, you'll see that the ball bounces on this queue months.
We don't want that. What do we want to
do is after hitting, we want to change the
collision response of the other component to
overlap with the sphere. So you'll need to access the other components
from the hip event. It's a one of the data pins. Find the null but changes
the collision response. Make sure it happens only once. And use the heat component data. And make sure that both
generate heat events. If you wanted to do this
challenge on your own, go ahead and do it else. I'm going to give
you a small hint. There's a node is set
collision response to channel. With all of that information. Pause the video right now
and go to the challenge. I know this challenge
was kind of hard. You probably had no
idea what to do. But what we want to do
is remove the overlap. And as soon as we get a hint, we want to do once. What we'll do is we are going to change the collision
response to channel. Change. Collision collision collision response or set collision
response to challenge. There we go. Now what we're
doing in here is we are selecting a target
and we're changing the way the collision on
a certain channel works. This can be done in many
ways, in many ways. In our case, for example, I can access the
other component. And we can even print it
out if we would want. After accessing the
other component, which is the cube. In this case, we can
select for it to interact differently
with a sphere, which is a physics body. So we are going to
select the physics body. Said the preset to overlap. So Compile, Save. Let's see how that works. If we play the
game, we get a head and then we have a overlap. How cool is that? But we can also do
something different. We can get the head component, the component of the sphere, and we can go into the spheres. The other component is the physics body also,
let's change it. Let's just have a
bit of variety. So let's make sure
that the other one is a world dynamic,
which is the Q. Now we are going to access the head
component, which is us. We are going to select
world's dynamic and we are going to select
that, we ignore it. We go compile save. Let's see. So in here at
the blocks, everything, so when we play, it bounces and then it overlaps. How cool is that? So as you can see, we have the ability
to manipulate the way we respond
and collisions. I know this has
been a long video. I'm sure it's very confusing. I know because
collisions was one of the hardest things I had
to learn and unreal. But trust me, once you
get the hang of it, everything makes sense.
Everything is easy. I know I didn't explain and
go too much in-depth in it because I know that it
cannot really be overwhelming. But I hope this example and this challenge really made you realize a couple of things. So thanks so much for watching. See you on the next one.
48. Damage In Unreal: Welcome back, my fellow
game developers. In this video, we are
actually going to put our knowledge to use
when we play the game. You'll notice that when we
attach attack the sphere, you'll see our
health going down. We are at ten. And finally, once we try
to attack the sphere one more time,
bank, we disappear. We are dead because there is no more helpful for
us to stay alive. So let's not waste any more
time and let's get started. Okay, so now that we
learned how to add collisions will learn how collisions will
respond to each other. It's time to use these
or all of these in something that is useful like adding damage to our player. First of all, let's
imagine that this is u. And u is looking at
the fireball of death. So the fireball of death is coming towards
you super-fast. And once it arrives
a true, it heads. Now, what happens here? Once it hits you, this will generate an event hit. Then we get the head info. We get information about where the head while
I hit the player. So we get who we hit. What's the component
that we've hit? Which part of the
player we've hit. We can get a lot of information out of the getHeight info, then we trigger damage. So what happens on
the ball is it calls a function to trigger the damage after
triggers the damage, and they applied damage advanced
triggers on the player. And once that event
is triggered, we remove somehow, we
check is the half gone? If it is, then we destroy the
player and our player dies. So very simple, very
easy to understand. Let's go into our
world and let's do that in the Unreal Engine. Let's make this a bit smaller. What we'll do here is we'll take these two experimentations and we'll just move
them to the side. Then we are going to go into the world setting
and change this to my game mode and select
the third-person character. So we have the third%
character moving around. Next we are going to
add a cube and here, so we'll add a cube,
will move it up. And let's change a
bit on its materials. So we'll change the material
to be anything else. Let's make it like
stone or something. Yep, stone seems good. And this is going to be the cube that is going to
hurt our player. We're going to convert this into a underscore death. And it will be a
static mesh actor. Select that. Now we have everything
sort of ready. Let's close this also down. So now we have the
cube of death. Once inside of the cube are
the four Actually we are going to make sure that
it generates a hit event. Let's just have an
overlap event. Why not? Let's see also the presets. Set it to customs, makes sure that the okay, great. I think everything in here should be good enough
when we play the game. On the queue and
the event graph. As you know, we used to
use the un-implanted, but now we can use
something different, which is the event ID. So if we right-click
and type in event hit, you'll see that we get this
different kind of event. This event will trigger
whenever an actor bumps into a blocking object or blocks and another actor
that bumps into it. This can work from both sides. This could happen due to
the character movement new to setting the location
and then moving towards it. Or simply by having some kind of physics simulation
hit on top of it. And you'll notice that we
get a lot of information similar to what the event
hit used to look like, but with an addition
of this hit result. And this is very
important because if we right-click on this and
split the structure, actually this is
not very useful. Let's try to try to break it. If you break the head result, look at how much
information we can get. We can get the blocking hit the initial overlap, the time, the distance, location,
the impact point, the normal, the impact normal. All of these things can be used. We can even get the
bone that we've had to whenever we are
using a skeletal mesh. So all of that information
is given to us by the hip. Now, let's continue on
and see what we can do from here once we hit. So let's say this is the object that's going to hit us even though we're going
to walk towards it. So once we get it, what we want to do is we
want to apply damage. You can see that this
is a function that we can give it a damaged actors. Which actors should be damaged? Damage the base damage, how much damage should we apply? The event instigator, what instigated this and
the damage causal, which is this can be us or
could be something different. And the damage types or what
type of damage this is. We're not going to
focus on all of these. We're simply going to focus
on these two right here. And we can get a return value
of the actual damage that ended up being applied because it's not just
the base damage. It depends on the
event instigator, the damage caused,
the damage type. All of these can be changed. So for example, let's say you
can create a damage type, isn't maybe that poison
amplifies the base damage. So eventually you
get more damaged. That's just things
that we can add. Now, what we can do is before Let's test this
out and see if it works. I'm going to the
other component, the other, Let's see
the object preference. Let's see. Okay, then I'm going to go ahead and print out, print a string. Let's just print out the
other component that got damaged or at least not
get damaged just for now, just had the damage
applied to compile save. If we play the game. We had the blog there, you see we are hitting
the third person. Excellent. Now how are we going
to actually call this? Well, if we go back
into collisions, we're going to search
for the third person. And we're going to find the ThirdPersonCharacter
Blueprint class. As you can see, this is our person with at
smash with its capsule. It's a normal character that we are going
to be modifying. You can see already in
the Event Graph we have things that are used
in order to jump, in order to touch, in order to move, and a lot of other things. But what we're going to focus on is actually the
event any damage. There we go. As you can see, this will trigger
whenever it is damaged. And this apply damage
on the cube of death is what's going to
trigger this event damage. On its own. The applied
damage won't do anything. It will only trigger
this event and whatever happens in here will
then just be triggered. So I'm going to try to
print a string and see what happens because sometimes
this doesn't always work. And we also need to keep in mind that we need to go
to the capsule. And on the collision, we need to make sure
that we generate a hit event just in case to
make sure everything works. And instead of hello,
I'm going to say got damaged with the
amount of damage, damage that was given to us. So Compile, Save, and
then the cube of death, I am going to remove
the sprinting. So Compile Save. Now when we play the game, hopefully we should
see there we go, that we are getting
damaged by ten. And we can change
this value from ten to 12 to 20 to
whatever we want. So as you can see,
we get a event ID. Once the player walks
into this cube, then we apply damage, we call a function this
triggers the event any damage from the
already damaged actor, which is the other component. This is very important
to understand. Okay, so now that
we are applying damage time to do
something useful with it, the first thing you'll notice is that as soon as I started
playing when I hit this object, I get all of these events
and we don't want that, we only want this
to happen once. So I'm going to
create a do once. One snowed. When should
we be recent thing? Well, after a bit of delay of, let's say two seconds maybe, or 0.2 is actually good. Yeah, let's just keep it as 0.2. I think it's good. Then we are going to reset it. There we go. Compile, save, and
now we should see that we don't keep
getting damaged. There we go Much better. Now let's go into
the third person and see what we'll do in here. First of all, we want
to add some health. This guy, I'm going to
add a variable in here. I'm going to make
sure that it is an integer because how you can make it a
float if you want. But we're just,
I'm talking about removing 1010 every
single time actually, let's make it an integer. Maybe you want to
make it a float. Maybe you want to
remove 0.2 or 0.1. So Compile, Save. Now what we're going to do is
every time we get damaged, I'm going to get the
health I'm going to subtract from
the health damage that was caused. There we go. As soon as we get it, we are going to subtract it and then we are going
to set the health. With the amount that is left. That way every single time we are removing a bit of health. Then what we're
going to do is we're going to issue you a
bit of a challenge. Your challenge is to
destroy the sphere. I don't know why I
called it the sphere. Just destroy the player, the one that we
are playing with. Keep track of the health. And if it goes below 0
and destroy the actor. If it's not below 0, then print out the health
left to the screen. So it's very basic. You'll need to create a branch, a condition on the branch. If that condition
should be the health, if the health conditions should be whether the
health is under 0, if it is, then
destroy the actor. This is your little hint. And if it's not below 0, simply print out the string, pause the video right now, and go to the challenge. Okay, welcome back. So I'm going to create
a branch in here. This branch is going
to check whether this is less than or equal to 0. If it is, then we are going
to go ahead and destroy it. So straw, the
actor, very simple. And if not, we are going
to print out a string, which is going to say V amount of health
left. There we go. Excellent, So everything
seems to be in place. We're going to compile, save. We are going to play the game. So now we are going to, before we do that, the half, the health is at 0. We don't want that
to happen because as soon as we trigger this damage, we are going to get
destroyed immediately. Instead, I'm going
to set it to 120. There we go. I'll compile, save,
play the game. So now we will walk towards the cube and you'll
see that we have ten. And if we stop walking,
this will stop. So we are at 403020 and boom, we got destroyed, so our
player actually died. Now we have all the mechanics necessary to create
a game where there are consequences
and we will see how that will look in later
chapters or sections. So thank you so
much for watching. I hope you enjoyed. Congratulations on making
it through this hard. I know this is one
of the most boring, maybe one of the
hardest sections because everything
is very theoretical. And I'm trying my
best to just show you as many examples
as I possibly can. Congratulations on
making it this far. If you're enjoying the course, please leave me a great review
with a couple of words. It helps me out a lot. If not, if you don't think I deserve a full five-star review, please feel free to DM
me or talk to me on this code or Instagram or wherever you can find
me in my description. Just tell me like this
section was extremely bad. Please explain more
on whatever now. Go back and maybe
change the lesson, maybe add onto this
explains some things more. And your satisfaction
is my goal. Thanks so much for watching.
See you on the next slide.
49. Section 10 - CyberSpy 3027 - Adding Physics To The Player - Creating A Damaging Environment: Welcome back, My favorite
game developers. In this video, we
are going to create a damaging environment
for our layer. What do I mean by that? Well, remember we had the enemy, but the enemy didn't
really do much. Now if you look at the
top left of our screen, you'll see that we aren't getting damaged
every single time. And finally, with
the final blow, we are dead and we are
actually out of the game. We have no longer the option
to play in it. There you go. You can see now our game
is much more scary. A lot more stakes are online, so let's not waste any more
time and let's get started. Okay, so we are back and
our cyber spy 3027 project. Now it's time to create
a damaging environment for our player because we
already have an enemy. He's not here, but our
enemy doesn't do anything. He's not scary, he
should be scary. So what does it mean to die? Not the philosophically,
but in the game, basically, that means that the
player can no longer move and weak with the
game. That's it. I'm going to open
up the content, the FPS character,
open up my character. In here. I'm going to do we have in here
basically nothing. So if we play the game, let's just make sure
everything looks good. Okay, Great. So back in my character, let's remove the
beginning played. I don't think we will
need it and we're going to create a
new custom function, custom event, dot
add custom event. And this custom event is
going to be called Game over. What happens upon the game over? Well, we simply quit the game. We quit the game whenever
the game is over. Pretty simple, nothing
too fancy about it. Now, we need to
go into the ball, the ball or death enemy, the BP underscore enemy. We have a lot of things in here, so I'm going to close
down everything. This is the Event Graph. That's really nice. I'm very proud and
hope you are too. You're doing this along with me. That's why it's important to
always do the challenges. Now we need to make sure
that the enemy overlaps. So an generates an
overlap events. So I'm going to go
into or width in me, where does the collision, why can't I find it? If we scroll down until the
collision, there we go, we are going to make sure that it generates overlap event. And on the Collision Presets we are going to
make sure that it overlaps of overlap all even
static meshes just in case, but we'll make sure that it
only damages the player. How are we going
to do that using all the tools that
we've learned so far. First of all, I'm going to
create an actor begin overlap. This is not what
we're looking for. We're going to type
in here, actor begin. Overlap, not the bind. We are going to select
the collision right here. So the under the
add event collision at actor began overlap. As you can see, there are
many options you always need to be diligent
and what you're doing, you can just be like
me just type in something had under
and hope for the best. From here we're going
to get the other actor. We are going to cast
it to my character. Now we know that it is the
character that we put. And if we did the character, we're going to apply damage. The damaged actor. Who should it be? It should be our bp
underscore my character. There we go. So compile, save the animal. What do we will set
the base damage. Now here's the thing. We're going to make
the damaged be 0.1. It will apply 0.1 damage and the health
is going to be one. And you'll see why later on as we move through the course, the damage factor is the same. The damage type will not
need to change any of this. I think this is perfect
for us to use, compile, save, and back in our level, let's go ahead and
add an enemy in here. Let's add enemy, move it up. And let's select this thing. And we'll just move it right
here in this direction. And this will be a
whereas the enemy, we will make sure
that this, Okay, so I was looking in
the wrong details. Let's make this a
little bigger. Yeah. Sometimes I don't like how everything is
squished in here, but you get used to it. I'm going to make him one
of the medium enemies. So now we play. If we go up in here, well obviously nothing
is going to happen, but Still that we can see
that we overlap all and B should get damaged. When you complete
your challenge. Your challenge is to
apply to character. Should have been applied
damage to character. I'm not the best
at naming titles. If you've noticed, call the event any damage
on the player, create a variable, subtract the health every
time we get hit and set it whenever
there is any damage. Make sure we do this only once. Don't want this to happen. For some reason multiple times. Check when health gets below 0 and call the game
over event if the die. Finally, if we don't make us invincible for a book and
then reset to do once. So there is your challenge. It's very similar to what we did in the last
section of the course. So pause the video right now
and go to the challenge. Okay, so I hope you tried
your best at the challenge. I know it's a bit hard. I know you're not used to it, but it is very important. Now before we continue on, I thought that maybe
0.1 is too little, so I'm going to set it
to 0.2, compiles the n. By the way, if you want, this is a great idea. You can actually promote this base damage to a
variable and you can then expose it on spawn that actually, sorry,
instance editable. And now you can set
it however you want and depend a negative
dependent on the enemy. This is a very good idea. So back in my character, here we're going to
create any damage, event, event, any damage. We are going to do
this once so, once. After we do once, we forgot to create
the variable. So I'm going to call this
variable the health. We're going to make it a float, and we're going to
set its initial value to be one or the default
value to be one. Every time we get damaged, we are going to subtract
a bit of health. So minus subtract,
really simple until now. And after we do, we are
going to set the health, drag this in here. The Health. So now at any damage, if we do it once, we subtract and we
said the health, after setting the Health, we are going to create a branch. And this branch is going
to check if the health is less than or equal to 0. If it is, then we'll
know that we are dead. So I'm going to go ahead and
do a game over that set. Game over. This is the event that
we created up here. So this is nothing new. This is what we just created. And you can see the target
is the BP, my character, meaning it's inside
the VP, my character. And then on the
false, if we don't, then we are going to
print out a string, which is going to be the health. Everything we're
doing in here is exactly the same as
we did previously. We're going to make it red and we'll set it to five
seconds, closes down. After we print, we are going
to add a bit of delay. Will set the delay
to maybe like this. Whenever you have a game, if you ever notice,
not 22 seconds. So whenever you have a
game and you're playing, usually what the game
developers or game designers do is they let you have
a bit of a cheat code, a bit of time for invincibility
whenever you get hurt, that way you will create a more fair game just in case
something weird happens. Let's say, I don't know, sometimes things
happen like maybe the enemy gets stuck on the
player while you're moving, he gets stuck or he hits
you twice or whatever. And you might feel like, well, why the tool, my health goal, this is not fair and
this will really trigger the player of your game
and make him angry. He wouldn't understand
what's happening. So it's always
better to just give a bit of time for the
player to be invincible, at least for two seconds, maybe less, maybe more. It will depend on you. And after the delay, we're going to go ahead
and reset it. Once. Compile, save. And let's see what's
going to happen. We're going to play the game and will stand in
front of the ball. There we go, 0.8. And you'll see that two seconds when it hits us from the back, nothing happens, which is good. Zero-point for your point too. And now we should 0. What happened? Now? We are that. Why did that happen? Because in my character we are checking if it's less
than or equal to. That's the whole thing. Like would you want the game
to stop when you get to 0? Or would you want your
game to stop when you are less than 0? So in this case, we are
not dying exactly on 0. We are lying on a bit more. But if you want, you
can change this. So for example, you might have noticed
and I was thinking like, why are we not dying on 0? This is very weird and
I've been testing things out and seeing why
this is the reason. Like for example, when we get to 0 and we're not there yet, We are named after. Now the problem is, what I'm not understanding is
that we set here, this is less than or equal to 0. At this point. If it's equal to
0, we should be, that should be true. I don't know To be honest
why this is happening. Like it. To work, it worked and the
project that we were doing, there is a very simple
solution to that. We can simply just set this
one to 0.1 and a non-metal, or we can even add
something else. I tested this if we
set this to 0.5, so the damage is
0.5 on the enemy. There we go. The second time we
die immediately. Now, why is this happening? I don't know. Maybe there's some
kind of glitch or maybe off the top of
my head right now. Not able to understand it. But to fix this, we
can simply set this to 0.001, compile save. And now if we select
the enemy and put him back down to 0 to play the game. Now you'll see that
once we then 0.6, the animate x again 0 for
the enemy attacks again 0.2. And now this final blow
should be our last talk. As you can see, I'm not honest, I'm not really sure what's the problem here is
maybe there's some kind of inconsistency in white
is working on the 0.5, not working on the
zero-point too. I wanted to show
you this problem because sometimes you like, this is what happens to me. Sometimes I'm not even
sure what's going on later on, keep this in mind. I keep it in the
back of my head. And later on I just come
back to it and I realize, oh, this is why. Thank you so much for
watching. I hope you enjoy. I hope you tried
your best during the challenge because
a very important one, there were a lot of
lessons to be learned, and I'll see you
in the next one.
50. Adding Spikes : Welcome back my fellow game
developers to another video, a very fun one. We've created two
types of spikes. These spikes keeps hurting us. So as you can see, we lose health as we are
standing inside. If we go back, we no
longer lose any health. These spikes, on the other hand, they kill us immediately. No mercy from these spikes. If we jump on top of them, we get, Let's not waste any more time
and let's get started. Okay, so let's go ahead
and start creating spikes. I'm going to delete this
player or the enemy from here. We're going to talk
about the two types of spikes that we
are going to have. It's very simple. The first
type is going to kill us immediately as soon as you stop on the spikes, you're dead. The second type of spikes are
going to be damaging ones. So let's go ahead and start
creating the depth spikes. I'll go into the content
and the content. Then I'm going to create
a new folder which is going to be
called the spikes. Spikes. These spikes, I'm going
to right-click and create a new blueprint class is going
to be based on an actor, is going to be BP underscore
death spikes and enter, open up the death spikes. Here we are going
to create a cone. This cone is going to be right, that centered, Oh my God. What happened? So something is going on. Anyways. Let's just add this
spikes right here. Close down the BP enemy, close down the left. Now let's keep the character
where we might need them. I don't know, no,
I don't think so. That's cools down
the character also. Let's check the floor so
we can see the floor. And it doesn't want
us to see the floor. And let's close this down
and try to open up again. Maybe we can see the floor. As you can see, unreal
is not always as responsive as we would
like it to mean. So I'm going to close this down, maybe set this to 0.2. Sorry. So apparently
this is Locke was made. So select this set the exon zero-point to set the y to 0.2. Maybe these are two
small animal 0.3.3. I didn't think like what
should be done in here. We'll just make them pointy. Yeah, there we go. There we go. Now we have
our first spike right here. We're going to duplicate it. So we'll call this
the spike duplicated using the Control
W. We'll just move it a bit to the right, maybe at 60 or maybe 90. Then we'll duplicate
this spike again or move it 90 to the other side. Now we're going to select all three and duplicate
all of these three. Move them. It didn't allow me to
do that. No worries. We'll just do it manually. Just set. I don't know. Sometimes unreal is
really on width. Duplicate that again, we'll just set nine of these cones around. There we go. Last one. Go, compile, save. And now in the level, if we drag and the
spikes, there we go. These are very menacing
and scary spikes. Let's look at them properly. Yep, seems to be good enough. This should be big, this should be scary, and these should actually be deadly before
we make them that, Let's change the select
all these spikes and let's change the material on them and let's see
what we should select. Maybe the floor. No. Let's see if we have some kind
of metal frame. Let's see. Yeah, those look good. Compile Save. Now let's be honest, there's
something weird above them. Let's make them not
glass obviously. Let's see. The metal. Metal seems
that good one. Yeah. Yeah. It looks very scary,
very menacing. And you can feel that there is a threat and they
are not touching the ground. So I'm going to select them. Go down in here. These are things that you
need to always take care of. So there are a bit
inside of the ground. Let's make this one. Okay, great. So
I'll compile, save. Now if we look in the game, we can see that
there are probably properly grounded and
they are extremely scary. So when speed walk towards
them, we need to die. So this is going to
be your challenge to apply damage while not damaged because we
are going to kill. But you'll see what I mean. First of all, create a
box around the spikes, create an overlap event. Kill the player when they
touch the spikes and makes sure the spikes
kill only the player. Then I'm going to issue an extra challenge to
create the damaging spikes that don't kill the player
immediately make them a bit smaller but different
than the regular spikes. And I'll give you a small hint if you don't need
any small hen's, just go on with the challenge. Because the Character BP you created in order to make
sure only kill the player. Pause the video right now and
go do the challenge. Back. Indeed, death spikes. I'm going to add
a box collision. And this box collision
is going to be as big as the spikes are big. Let's move it up right
here and make it big. There we go. So as soon as the player touches them or thinks of touching
them, he's going to die. If you want. We can make this a
little bit smaller soap. We actually fall between these bikes sense very
menacing and scary. So Compile, Save. Let's call this the kill zone on the spikes are going to
add an overlap event. So on begin overlap on the box. We're simply going to cast the other actor to my character. And after we've cast, we make sure that it
is the character. And then we are just
going to call Game. Over. There we go, compile, save, and now when we play the game, we jump, BAM and weird bed. How cool is that? Really nice? Now, let's
create the damaging spikes. So I'm going to duplicate the depth spikes and
I'm going to call these damaging spikes or
damaged Spice, Spice spikes. So that's opening
damaging spice. Let's remove these. We are going to
change the kill zone to damage damage zone. We're going to go
into the viewport. We are going to change a
couple of things in here. So first of all,
let's select all of these spikes will make
them a bit shorter. So maybe 1.2. There we go. Even less. Maybe one sure will
make them a bit fatter. Maybe even a bit more fat. Sorry for the word fat, I'll use the word. I don't know.
Wider. There we go. This spike seem a bit different. Due date. Let's compile and compare them. So if we add the damage spikes, we need to make sure
that it's really obvious that these are
just damaging ones. Maybe make them a bit shorter. So maybe make them 0.8. Yep, there we go. I think this is perfect
because it really makes them very small or
very not threatening. Still threatening because they are obviously these are spikes, but they look like you might be able to
walk through them. I'll make this 0.6. Nope, sorry, 0.8. Let's select all of them. Make this 0.60.7. I really, I like to play around with these things and I
recommend that you also do maybe you want your spikes to be
completely different. I totally understand. And we're going to select a different type
of metal on them. Maybe copper compile save. Let's look at that. Seems good enough for
me. Let's continue on. Stop wasting that much time. Select the damage zone. Let's go and begin overlap. Only begin overlap. We are going to Shack
for the players. So cast to my character. So this is my character. And we are going to apply
damage. There we go. The character is going
to be the damaged actor. How much damage should do, let's say 0.1, compile, save. And now we should see that
when we play the game, we walk towards these spikes, we get damaged 0.90.8. Excellent. Now what I want to
do is I want to make sure that these
damaged spikes, if we select them, Let's see. Oh my God. Let's see, where's
the collision? Select all of these, scroll down to the collision, makes sure that we generate
the overlap event. And on the Collision Presets, Let's make sure that we have only the spikes selected and this
blocks all dynamic. I'm going to set it to overlap all compile save or we
can set it to ignore, to be honest, maybe
that's better. Let's select to just ignore all. Whereas it, where is it? Whereas ignore,
ignore only ponds. Sure, Ignore only ponds
or bad compile save. Now if we play the game, we shouldn't be able to
just walk through them. And since the box
is the person or the object or the component that is taken care
of the damage, nothing is going to happen. Now, it's time for a
bit of philosophy. In this case, you might
be thinking, well, the player just
walks to the spikes, he gets damaged, but then
there is no more damage. If we're standing
inside of the spikes, we don't get damaged. But what if we do want
to keep getting damaged? If we're standing
inside of the spikes. You might be thinking
in this case like this really
will depend on you. Would it be more logical
that the player can stand between the spikes
once he gets it gets hit. That might be the
logical way to go about because there's space in
here between the feet, between the each
spike and you can put your feet inside so you
are pretty much safe. But if you want, you might be tempted to add a
bit more like urgency. So once you stop on
inside of the spikes, we need to get out
of here immediately. We need to jump as soon as
we possibly can outside the outside of the spikes to
not lose all of our health. Going to implement the
damage being always given, whenever we are standing inside. And then you can choose how
you want your game to be. I'm going to go in here. Let's remove these two and we're going to
use the event it, sorry, the event thick. I'm going to create
a new variable in here that is going to be called layer inside. And from the event thick, I'm going to create a branch. The condition on this branch is going to be as player inside. The player isn't side. I'm going to apply damage. There we go. And the damage I'm
going to apply is the same one that
I had down here. Now. Here, instead of the begin overlap applying
damage immediately, we are going to set the
player is inside to true. So now when the player steps
in and the damaging spikes, excuse me, the player
inside play the game. Once we step inside, we don't see anything
happening because there is, oh, we need to set the
damage the actors. So let's just drag this
damaged actor and here, compile, save, bile, save. You know what, actually I
don't like this too much. Let's remove this and actually promote
this to a variable. My character. Yeah, there we go. That's much better that way. We'll set it you for
it actually damages. There we go. Save. Now we are going to use
this character right here. So Compile Save. Now when we play the game, there we go, we get damaged. Excellent. Now the problem
is when we stop outside, we keep we keep getting
damaged, not good. So back in here, we're going to create
an on and overlap. On an overlap, we are
simply going to copy these. So Control W, simply
copy these and use the other actor that has
stopped, stopped the overlap. And the other actor, Why is it not allowing me
to use the other actor? How did that work? So sometimes things
are just weird. We're going to set
the player to false, and now we are no longer going
to be damaging the player. So we'll step
inside. There we go. While we're inside, we
keep getting damaged. If we step outside,
there you go. No more damage
being dealt tools. I hope you enjoyed this video. I hope this was
not too confusing. If there's any questions. I'm sure there is
nothing too new in here. We're not doing something extraordinary would just
setting up the character. This could be a bit
more efficient. I don't like every
single time casting and every single time getting the
character and the variable. I don't know, it
seems a bit weird, but we'll work on that later on. Thank you so much for
watching. I hope you enjoyed. Hey, this is Michael
from the future. So I did this outside of the
realm of your visibility because I wasn't sure if it will take too much time.
But there we go. I fixed this will
really like because casting takes a bit more
energy from the processing. So I didn't want to always keep every single time casting. And also because
it's inefficient, we already have the character. So instead, what I did is
whenever we end the overlap, we get the other actor. We compare it to my actor that we've
already gotten in here. We check if the my actor and the other
component that left the overlap sphere or the overlap damage zone is the same exact one
using the equals. If it is, then we
will set the player inside back to pulse. So now when we play the game, there we go, we get damaged. When we go outside. There you go. There's
no more damaged. So I'll keep this
in front of you. I hope you understood
what's happening. It's very easy. We are simply getting the component that left. The actor that left. We are comparing him
to the character. If they aren't saying
the person that went in as the same that
went out on the branch, we are making sure that the
player is no longer insight. Thank you so much
for your patience. I know you're like, Oh, finally we loved this video. No, I always come back, See you in the next one.
51. Adding Gems To Pick Up: Welcome back, My favorite
game developers. In this video, we've created
a mechanic that will allow us to actually
progress through the game. As you can see, we have these
four jumps floating around. And all we have to do is just walk towards the
jump and pick it up. And you'll notice there
is a small number on the top left of
the screen that indicates how many gems
we have collected so far. It's been for, It's
been very fun. It's been a bit long, but it's been very informative. So let's not waste
any more time. And let's get started. Okay, so now that
we have are ways to die using the spikes and
the death enemy, whatever. Now, it's time to
actually create a mechanic where
we will be able to pick up enough gems
that will open up the door and we
can go through it. So let's go ahead and do that. I'm going to go into the content and I'm going to
create a new folder in here. And that's going to be called the gems or the pickup gems, or just call it jumps
inside of the gems. I'm going to create
a new material. This will be the m underscore. Whenever we are
creating a material, rename it, underscore. Gold gems. Double-click to open it up. I'm just going to do
a very basic things just like we did
the other colors. And actually, you know
what I'm thinking that don't actually
need to create this. Going to delete it, I'm going to find the
platform, the door, door. Just simply drag that
over into the jams. Copy here in the gems we
will have the glow green. We'll call it the gold gem. There we go. Let's open
it up and we'll change this from the red,
which was red. Now it shouldn't be gold. Let's double-click
and open up the gold. And let's see, we're going to
set it to like a yellowish. Think like it's gold. I don't know what gold is,
to be honest with you. But I think that will be enough. So let's add it right here. Now let's go back and the goal jam you should
see, let's apply this. And then just the bit you should see that it changes right here, but that's okay for now. Let's save this and the day now. Okay, there we go. Now let's right-click and
create a new actor. So a new blueprint actor, which is going to be
the VP under score, pickup Gems, pick up gem. Let's open it up. The
first thing we're going to do is going
to simply add a cube. We are going to scale it
down on all sides plus 0.4. And we'll move it up a bit
in the air and we'll add a 45-degree angle
similar to the, let's see which way. I'm on the x-axis,
just like that. 45 degrees. Give me five please. There we go. So 45
degrees compile, save. Now back in the Event Graph by wanted to add a
bit of rotation. So I'm going to delete this. Before we do that, we also
need to go to the cube, and let's call
this the gem body. There we go, and we'll change the material on it to be gold. Gold jam. Yeah, there we go. Compile save. Now if we add this to
the level and I think we should maybe take
this down a notch. I don't know. What do you think? They think it's cool,
glowy. Feel that. Why is it the leg? Some reason there's
a lot of lag. I don't know why
sometimes that happens, but in any case I want
to set this to 0.4. I don't really need
this to be glowing. Let's see. I think that's enough. So if you play the
game by thing that, or this is good enough, maybe it really depends on you. If you want, you
can increase this, I think zero-point
for maybe 0.60.6. Just a faint little glow. There we go. We
can see that now. Okay, It seems good
enough for me. Anyways, back in
the Event Graph, I wanted to have a bit
of rotation to this gem, so it doesn't look that. I'm going to right-click
add the thick. For some reason I deleted it. I'm going to add world
rotation, world rotation. And it's going to be the
target's going to be the jam. Jam. Body. Why can't I attach this? Well, because the
target should be an actor. You don't want that. So we'll add a world
rotation. There we go. So I don't know if you've
noticed what happened, but let me just
add oral rotation. This is important to understand. If you look right here, this target is actor. That's why whenever we
tried to add the gem body, which is a mesh static
component that didn't work. While if you look on
this world, this one, the ad world rotation, you can see that the
target is seen component. So this is very
important to understand. This will save you
a lot of trouble because I remember when I
started learning unreal, I was like, What
It's the same white Can I use the gym body
and I was very confused. And all the courses
that I watched, all the training that I've done. Not all of them really
explained the sports. So anyways, let's continue on. I will add a bit of
rotation on the z axis. So compile save. And we can actually simulate. If we simulate and
go to the viewport, you can see that this is how
the cube will be moving. Great. Now let's add a
bit more rotation. So we're going to drag off up here and add Local Rotation. Anybody local rotation. There we go after
the world rotation. And let's add on the x-axis, compile, save, simulate, and
let's look in the viewport. Yep, there we go. I really liked this
kind of waving thingy. So now when we play the game, we have this or moving around, and once we collide with it, we should be able to pick it up. Let's move it a bit down. I want to be able to add a gem and have it
immediately be placed. Would you like to save changes? Yes, apply the changes
on the viewport. Let's start simulation and
we'll move the body a bit up. Let's change this to
world coordinates and this body about a 150. Let's see how that looks. Compile save. I think that's good enough. Maybe you want a
117 just like it feels a bit high in the
sky when we play the game. Okay, that's too
high in the sky. Then maybe 140 file saved
back into the game play. Okay, perfect. So now
we have this jump. Next thing we're going to
do is we're going to add a box collision in here. We'll just make
sure that it's on the under the under the box. We need to make sure that
it's outside the jump box. We'll call this the
pickup trigger. Pickup trigger. We're going to add an overlap event to it. On begin overlap. What will happen when
we begin to overlap? Well, first of all, we
want to do this only once. Then we'll want to make sure
that it's my character. After we do at once this around. Let's make this a
bit by the year. Then after we know
it's the character, what we're going to
do is we're simply going to destroy the actor. Destroyed the actor that
we have right here. And so it's the
gym, It's the self. So now we should see
when we play, oh sorry. We adjusted the box a bit. We'll get the box
like fast right now. But to be honest to do
like I feel you are already a seasoned
developer by this point. So we'll make this a bit bigger
than its size so we don't have to stick our necks inside of it in
order to pick it up. Just make it 90 by 90. Think it's good enough. Now compile save. And when we play the
game, there we go. We have picked up our channel. How cool is that? The only problem that is
still here is that we need to actually have a way to open the doors when we
pick up the champs. And in order to pick
up or a hat in order to open the doors when
we pick up the gems, we need a system that allows
us to actually be able to add these gems and
increment the number of channels we've
collected because we won't have only one gem. We might have ten jumps when we need a system to
keep track of them. So this is going to
be your challenge to make the chance collectible. So first of all, create a
variable and my Character BP to keep track of
the collected jumps. After we pick up the jumps, but before it gets destroyed, acts as the variable
and incremented by one. Set the new value
of the variable, and print out the
number of chance collected every time
you pick one up. Pause the video right now, and go through the challenge. Okay, So the challenge, hope it wasn't too hard on
the content FPS character, open up my character. In here we're going to create a variable which is going to be the collected gems. Now, there are two philosophies
that we can do in here. First of all, we can just go
to the gems in the event of graph and just use
everything that we have in here just to
add the gems together. There is a small problem that sometimes like
the collected jumps, which should be an
integer or a byte, just keep us an integer. The problem is that
the collected gems is a variable of character,
of my character. So I think that it's better to actually change this variable
inside of the character. I'm going to do is instead of just in implementing
everything there, where I get the collected gems from the character right here. Instead, what I'm
going to do is I'm going to create a
function in here. And we'll call this the increment jumps from
the increment germs. I'm going to get
the gems collected, compile, save, and the chimps collected
should always be 0. As a default, I'll get
the collected jumps. Then we are going to set the actually
increment this sold. When we add two pluses, we increment the integer. And maybe you didn't
know about this, or maybe you didn't
know about this, but you could have easily
just added a plus. So add one in here, it's exactly the same, but increments just adds
one so it's more efficient. So we add one in here. And after we've added one, we are going to set the gym. There we go, compile, save, and if you want, you can create, create
a return value, but I don't think
we'll need it for now. We'll make it not private. This is important, so Compile, Save, back in the pickup jump. Just before we destroy it, we are going to access the increment jumps
connected right here. Also all let's go ahead
and print out the jumps or print. This will not work. Print a string with the amount of chance
that we've picked up. Compile, save, and
let's see what will happen when we duplicate. These will have four gems. Play the game. First one, there we go, 1234. How cool is that? I hope you understood
what I didn't hear. This increments simply adds one to a specific integer,
whatever it is. Honestly, I the whole time I was thinking of just
adding it in here. But it's very important to understand that
variables that are created in my character should be changed
in my character. And maybe later
on we will create some kind of output to
this function so we can access the
collected jumps most probably that will be something
that we will need to do. Stop. Thanks so much for watching. I hope you enjoyed this video. I hope you did your best and always do your best
and the challenges. And I'll see you
in the next one.
52. Finishing Exit Door: Welcome back, my fellow
game developers. In this video, we finally do it. We finally create our game
with a fully functioning work. So as you can see,
the door is red. If we go inside it does a
stoop pick up all the gems. We pick one. And
on the third one, we have all of them picked up. The door turns to green. When we walk towards it, we go to the next level. So let's not waste any more
time and let's get started. Okay, so now that we have the mechanic of
picking up our gems, it's time to actually
open up the door whenever the proper amount of jams
have been picked up. Let us go to the
door, open this up. The view port. We are going
to add a box collision. This box collision,
once the player enters through it is going to
take him to the next level. So I'm going to
make it not so big. Let's just move
it up and make it big enough on these
axis, There we go. So I think that would be enough when the polar bear
comes towards the door, maybe increased a bit
more on the y-axis, so we don't have to
like put our hand side. This is always a good thing. Maybe actually make it smaller. This is what's making
all the videos long. I'm very decisive
on these things. So Compile Save. Now we're selected the,
let's call it the level. The next level trigger. Next level trigger. There we go. We'll scroll
down on begin overlap. We are going to get the other actor and we're going to check if he's the player, outcasts to my character or the character I keep using the player and the
character at the same time. We're also going to
do this only once. So once we are going
to check in here, once we're going to
create a branch after it, we're going to check a
variable in here which is going to be Open. There we go. If it's true, then we're going to
simply print a string. Go next level. And if not, we're
going to print out pick up the chance jams, and then we're going
to reset the two ones. There we go. Flags similar to this. Just so we can properly see
where all of this is going. So basically, let's
delete all of this. We don't need it for now. Basically what we do is
we check for an overlap, get the other actor is
here's the character. Then we will do
the ones we don't want to do with melt
multiple times. We check on a branch. Can the door open? If it can, we go to
the next level if it can be need to tell to pick up all the gems
and then we will reset into ones to go ahead
and do it again. Next thing we need
to do is we need to actually keep track of where the game modes are or where
the gems are and how many. The next step that we need
to do is we need to keep track of the gems that
we have in our level. So currently we have
these four jumps. We want to pick each
one of them up, but we don't want to really have to force it
inside of the level. Maybe we have two jumps, maybe we have one jump, maybe we have 15 jump. We're going to create a dynamic way of
keeping track of these. And where's the best
place to do such a thing? Well, obviously it's
in the Game Mode. If I go to the FPS character, open up the game mode. In here is a great place to keep track of the gems that
are in each level. And we're going to
make it dynamic. So either least at
the beginning play, I didn't want to do that. What I'm going to do is as
soon as we start the level, I'm going to add a bit of delay. Why am I adding this delay? Well, because we want
to make sure that the, all of the level has started, all of the gems have
been instantiated, and then we are going
to count these gems. This will be seamless. The player will not notice, and it will help us out in
case maybe we don't catch all the gems made
it the game mode starts and we have
the beginning play. And then the gems start, and then we don't
catch all the jumps. So that's basically next
we're going to get. Of actors, of class. What class will that be? Well, it's going to be
the pick-up pickup jump. Now we get a reference to all the actors of type
pickup Jim in the level. Then we will have the
factors which are here. Then what we'll do
is these out actors, which is an array. We will get the length of that array and we're going
to set it as a variable. So we'll right-click in here. Promote too valuable
is going to be the required orbs or gems. Required gems. There we go. So now we
have the numbers of, number of jumps and we can
simply print that out. I'm going to print a string
with a number of jumps. So I'll compile, save. And now we have four gems. We should see a four
at the top here. When we play the
game. There we go. We get for how cool is that if we try to
duplicate this one, for example, now
we play the game. There we go. We have five, So now we have an accurate
counter for our jumps. That's amazing. And we all do this
all dynamically. We don't need to
hard code anywhere. So again, what's happening
in here and the game mode, as soon as we begin
play, we add a bit, a bit of delay to make sure
all the gems and instantiate, we get all actors of
type BP pickup jam. We check the length, we get the array of
the actors right here. We check the length
four of these actors. And the length of these
actors are put inside of a variable which has
the required jumps. Now, the next thing we need to do is we need to
make sure that we check on the Opendoor when ever we pick all of these gems. I'm going to go into
the pickup jam in here. I'm going to get a
reference to the door. So on the begin play, Do we have a began play? Nope. So on the Begin Play, I'm going to add a bit of delay. Also. On this delay, I'm going to get actor of class. So get one actor of class. We don't need many actors. We know that there is only
one door type exit door. And we are going to promote this to a variable which is going to be our exit door. Great, so now we have a
reference to the exit door. The next thing we want to do is whenever we pick up a jam, we want to have the
option to check the door. If the amount of gems
picked up is the same as the amount of
gems that are required. And this is going to
be your challenge. First of all, you need to get the game mode and cast
it to my game mode. This is all happening
inside of the exit door. You'll need to get
the player character and cast it to my character. You'll need to access
the required gems and collect and collected
gems respectively. Respectively, meaning
the required jumps on the game mode, the collected gems
on the character. Then you'll need to check
if they are the same and said the can
open as a result. Next, if it is,
then you'll need to set also the material. And finally turn that into a public function
so that we can call the check door on every single for an all other areas of our game in every
other Blueprint. So pause the video right now. Take your time. This is a bit of a
tricky challenge and go do the challenge. Okay, So how did you
get on with that? I hope I'm really hope
that you tried your best. Where should we be starting? Obviously, it's
in the exit door. And the first thing that
we need to do is we need to get a reference of our player or our character
and our pickup gems. Actually not on our
character and our game mode. Where should we be getting it? Well, let's do the begin play. The beginning play. We are going to cast. We are going to know
actually not guessed. We're going to first
of all, get Game Mode. And from the game
mode we are going to cast to my game mode. So now we have a reference and maybe we just
delay this also, maybe a little bit, maybe 0.2 seconds,
that's good enough. Then after that, we are going to promote
this to a variable. This will be my game mode. After that, we're going to get player character, get character. And we're going to
cast my character. And we're going to
also promote this to a variable which is
going to be called. It's something my character, I'll compile, say now we have the game mode and
we have the character. Now the next thing
we're going to do is we're going to check
for the open doors. So I'm going to create a function in here
that is going to be called Check open door. And from the open door, I'm going to create a branch. Condition on this branch
is going to check if the my character gems get collected is equal to I don't know what
it puts it in here. Anyways, is the same
as the my game mode. Gems get, require the gems. If they're equal. Let's make it a bit neater. Move it up. There we go. If the collected gems
on the character is the same as the required the
gems on my game mode. Then after it's true, we are going to get the Inner Glow door and
we're going to set material. That material is going to be
the green, the green glow. And after the green glow, we are going to get the open. And actually we can set the set the get opened
immediately from here. Let's see what shall we do? Let's set the can
open right here. And the value of the can
open will be based on this. There we go. Compile save. And they can open as usually
set to false compile save. What else we can do. I'll actually this, this
will never be a problem. What I was thinking
of is maybe we can in the beginning
of the exit door, maybe in the beginning
play off the exit door. We can set the material to
be red? I don't think so. I think that most probably
whenever we have a door, It's always going to be read
and will always have a jump. Now if you want to
go the extra step, you can set the
material here based on the can open. I'm
not gonna do that. We'll just compile, save, and we're going to go to
the viewport. This is red. And we're going to
also make sure that before and after we
increment the gym, we're going to get the exit door and we're going to check, open these dots, compile save. And now when we play the game, we should see that our
door right there is red. We pick up the first,
second, this one. And now when we
pick up this one, we should see the
green, hopefully. Very good. How cool is that? We finally have a very
well functioning game. Let's try to delete two of these orbs and
test this out again, make sure that it works
always one to bump when we pick up the last
one, it simply works. So excited. I've loved when
these things work out. I hope you did the challenge. I know it was a bit hard, especially when it comes to
maybe comparing these gems, maybe when it came to
calling the function. But as long as you
did your mess, That's the most important. Think. So. Thanks so much for watching. I hope you enjoyed this
video and I'll see you. The next one.
53. Section 11 - Working With Audio - Audio In Unreal: Welcome back, My favorite
game developers. In this video, we are
going to be delving into the magical world of music
and the Unreal Engine. So if we walk around, we don't hear anything
but right here, there is a hidden
trigger volume. If we walk inside of it, you'll notice that sounds
and music starts playing, which gives us much
more ambiance. And if we walk outside of it, there we go, you can see that
we no longer hear anything. So let's not waste
any more time. And let's get started. Okay, congratulations on
making it to section 11. It's time to start
having more life, putting in more
life into our game. So as you can see, I created a new level and
the mind first game project. And in here I'm going to
talk about the sound waves. This is the audio testing. So first thing first, I'm going to go ahead and select the sound audio filter
or soundwave filter. You can find that
right here under the sounds and
select sound wave. So let's click on that. And in here you can see
all of these sound waves, sound waves that we have. We can add the level
and play the game. You'll see that we
immediately can hear it. So I'm going to select
the starter music. You can click right here
and preview the sound. When I drag this in here, you'll notice that I've
created a new object, which is the pipe ambient sound. And this ambient sound has
an old your component on it. When we play the game. There we go. You can
see that we can hear the music all the time
on this audio component. If we scroll down in the details and then just
make it a bit bigger, you can see that we can
change a lot of stuff, such as the volume multiplier, the pitch of the
pitch of the sound. We can change the attenuation. Attenuation means the way the sounds spreads over
a certain distance. We can make sure that we
override this attenuation. So you can see
immediately we have the sound inside of this little
circle which is perfect, and then the sound
which is around the circle and the farther
you go, the last few here. And finally, when
you're outside, you don't hear anything. We'll be talking more about sound attenuation and
the upcoming videos. This is very
important and we also have the option down here to, let's keep this on
to press it out. We also have the way we
can do the attenuation. Let's not worry
about that for now. And if we scroll down, we can see that we
have somewhere here, the ability to, if I can find
that so the auto activates. So if I turn off the auto
activate and play the game, you'll see that we
don't play the sound, so we can choose what
we do with this sound. So if I open the content
browser up again and double-click on
the starter music, you can see that we have
many, many more options, such as the MBE sonics. Not sure what that is to be
honest with you, the quality. So how much we compress, what is the sampling rate? We can change the streaming
so how it sounds, the force of, by the way, I'm no expert on audio. All of these things require
a lot of due diligence. A lot of smart people in the audio community,
as you can see, I can barely remove the background noise
from my microphone. So all of these things really
do like, as I've told you, that there is a department
for level creation, there's a department for coding, there's the apartment
for the views. So how do you add materials, creation of materials
and textures? All of these are departments
in when it comes to a game, it's almost impossible to
create a game on your own. You cannot have that
high of a level. Now, it's possible obviously, if you want to be one
of those crazy people that sit all day and thus only game development
tool you can do that. But as you know, it's like if you want to go for, get a team, if you want to
go first, do it yourself. So let's also talk
about subtitles. For example, you can add your own subtitles
when the game runs, if it has any dialogue
or something, this can be used, for example, when you are having a
conversation with someone, can also add some analysis
into it and a lot, a lot of other options. Now, it's not only that, we also have something
called the sound cue, and we can convert
this starter music. So now if we play the game, there is no sound because we didn't turn on the
auto activate. But anyways, that's
not the point. The point is that we
want to play the sound. Whenever we actually
trigger it in the game. So what we're going to do is
we're going to go to Create, go to volume, add
a trigger volume. Let's just add it in here. We'll make it a bit bigger. So make the bounding box
a little bit bigger. Now we're going to save this. Whilst the holding it will
go to the content and in the blueprint and open
up the Level Blueprint, it's pretty empty in here. So right-click on the trigger
and create a reference. Here we are going to get
the actors location. Get actor, actor location. And why are we using this? Well, because we want to
play sound at location. Location and we'll play this whenever we trigger the volume. So on are on the begin overlap, so we'll add an event on the
collision on begin overlap. It's okay, We will not have
to add any casting for now. So compile, save. And what will happen right
now is we are going to play a certain sounds and we can select the sound that
we want to play. For example, let's say it's
the explosion, compile, save. And right now if
we play the game, if we walk right
here, there you go. You can see that we play this explosion sound when
we walk into this area. Now there are many ways
that we can play the sound. We can also, instead
of playing a sound, we can span an audio component in the level and then play it. Which is going to be a
challenge for you to try. Trigger spawning sound. Instead of play
sound at location, use sponsor sound location. Then create an end overlap
on the trigger volume. Used stop mode. So uncheck the
context sensitivity. This is very important
because you will not find this top node unless you uncheck
the context sensitivity. Then set the target as the audio components bond
after we trigger the volume. So it's going to be the return value of this
bond sound at location. Okay, great, so pause
the video right now and go do the challenge. Hey, welcome back. So how
did you get all of that? I'm going to remove this. And I'm going to instead play
or spawn sound at location. And the location, by the way, it can be the other
actor if you want, you can get the actor
location similar to this. It really depends on you. We can try it if you want, but it's going to
sound the same. Eventually, the sound
that we want to spawn will be the explosion one. Then when on begin
overlap, on end overlap. So we'll call an
event the collision. And on end overlap, we are going to remove the cost. So if we try to stop sound or
something, we don't get it. If we removed context-sensitive, you can see that we can stop. Let's see, stop. One of these. Okay, so I'll stop on the audio. This is what we want. Audio. Let's see. Okay, there we go. This is the stop which
stops an audio component. There we go. And now we can set the return value from here. We could have also
used this stop. This would have been possible. We can also stop the late. We can delay the
stopping, compile, save. And actually instead
of the explosion, let me use me use something
that is continuous a bit. So this, there we
go, stop the music. It's better than that
way we really know that. Stopped. There we go. While we're inside, we can hear the music. And if we stop
outside, There we go. You can see that we
stopped the music and I hope it wasn't too loud. I can barely heard myself speak. Let's try this
again. There we go. So as you can see, we
are playing the music. We are stopping the music. So thank you so
much for watching. I hope you enjoyed this little introduction into
the audio world of Unreal. And the next video we
are going to be talking about the sound cue editor. So I'll see you. There.
54. Sound Cue Editor: Welcome back, my fellow
game developers. In this video, we are
going to be learning about the sound cue editor. So as you can see right here, we have two sounds, the collapsed one and
the collapsed too. You can set it as the explosion. And we have a random node
and we have the output. So when we play the queue, you can see that we
play a random sound because of this random
node right here. So let's not waste any more
time and let us get started. Okay, so currently we have
the ability to add sounds. We have the ability to
respond sounds and stop them. But what if we want
to go a bit deeper? What if we want to change
a bit of things and add more variety to our
music or to our audio. We can simply just
rely on what we have on the options that
we have on the sound wave, we need to go a level deeper, and that level is the sound cue. So the behavior of audio
playback and the Unreal Engine is defined within,
within the sound. And the sound cue editor
that you'll see right now is a node-based editor that is
used to work with audio. So let's get started by
creating a sound cue. First thing we'll do is we'll go into the
content browser. And in the contents right here, we'll just, let's remove
the sound wave for now. We'll right-click in here. We'll go to the where is it, where is it the sounds? And then we will
create a sound cue. We'll call this
the, I don't know, just testing underscore
queue. Open this up. As you can see, we
have this node-based. So first of all, we have
the toolbar, the details, the audio graph right here, and the palate where we
can select various nodes. So similar to all
the nodes that we can select if we
right-click on the world. So let's talk about
each one of those. First of all, we
have the toolbar, we have obviously the
Save the browser. We can use the soloing the queue for our ear
phones if you have any, any, we can mute the sound, we can play the whole cue. Or if we have a
specific node in here, we can play that specific node. You also have the stop that
allows us to stop the music. Next we have the Details panel, where the Detail panel displays the properties of the
currently selected node. If multiple nodes are selected, the detail panel displays the common properties
between them. Next we have the audio graph, and you are now familiar
with how graphs work. So the audio graph is located
in the viewport panel. This is the view port
of our audio cue. Cue sound. The queue displays
the audio signal path from left to right to
width interconnection, interconnected nodes
representing the audio control. And finally, we have this output node that
is already here. This always has an image
of a speaker on it and it comes already
positioned with the sound cue. And this is the
output that we have. This will create a
combination between the nodes and finally played
out, out of this one. So the output's no
default has a volume of 0.75 on the volume multiplier
and a pitch sound of one. So let's try and play something. We're going to add a sound wave. So in order to do that, we are going to
add a wave player. If we add that wave
layer, we click on it. We can see that we can
create some kind of wave. If we play this wave, for example, we can then
set it to the output. And now if we drag this
sound acute into the world, you'll see that it also, we add the sound cue, ok, so we play the
game. There we go. You can see that
this gets played. Who can play this
individual node and this individual node, or you can play
the entire result, play q right here. But we're not going
to test it now because it's going
to be the same, because we haven't
added anything else. Now let's talk about the various palettes options
that we have in here. Obviously, I'm not going to go into every single one of them, but let's just have a bit
of understanding of each. First of all, we have
the attenuation. If the attenuation is
attached like this, you can see that we can change and override the attenuation. So how the sound will be heard
over a certain distance. That's the leader. Next we have the branch. The branch, as you can see, it's similar to the branch
that we had previously. If we duplicate this and
play the collapsed, here, we select the collapsed sound to select it here based on the
parameter that is given, the sound will play
either true or false. If I connect this one right
here and play the queue. There you go. You can see that the second one gets played. If I play this one, there we go. Now you might think that
this is very stupid, but if for some reason have one of the parameters between
random or something, this can be really fun. For example, if I
find a random in here and we set both of these. By the way, even this is
not that helpful because if we play the cube,
nothing happens. We'll need a parameter. So random. We select this one. And this one, we could just immediately just add
this right here. But just for the
sake of testing, let's go ahead and add
this here. Play the sound. So when we play the queue, the queue, play, play,
play, play, play, play. There we go. As you can see,
this is the branch. At the same time we
learned about the random. How cool is that? Next we
have the concatenated. This concatenated is
really, really fun. If we add this one. This concatenates
two sounds together. So they concatenate
or NADH is used to play sounds sequentially, not, not at the same time, but as a sequence
one after the other, we start off by dual pens, but we can add multiple
pens right here. So if I play the sound cue, there we go, you can
see that they play one after the other. Next we have the continuous
model it modulator. So the continuous
model later node provides a way to control gameplay parameters
for the volume and the pitch modulation. So as you can see right here, we can change the various
parameter and the minimum, minimum output, the maximum, maximum output in the
***** and on the volume. And we have many
things we can select whether the parameter mode
is an absolute or direct. I know almost none of
these makes sense, but as I've said,
these are deep, deep things and I just
wanted to give you a general idea or
maybe you are very interested in
tweaking your sound. This would be really great for you if you don't care and just want to create a game with
some sounds, that's also good. That's why we're not
hovering over them too much. Next, we have the delay, which is pretty simple. Simply attach this
layer right here. And if we click on the
delay, we can delay this. We can add a random delay. So the minimum
delay, for example, it would be 1 second, while the math maximum
they would be two. So now if we play the
queue there regards so we had a lay of I
don't know what how much what else
would we talk about? We have the dialogue player, which is a very fun one. You can see that we can select the speaker and the directed at. And this will allow you like if you've ever played
like for example, GDA or not GTA, I don't know which game
we should. The key I do. There is also a good example. If you have a dialogue
between two people. If you stand behind that person or in front of the
person who's speaking, the sound will be different. So this is very
important to know. Also, dialog layer
can really help. Obviously, you need
a dialogue wave, so you can go do that right ear. What else do we have? We have modulator.
If we add that, you can see that we can change
the pitch and the volume. This is very important. So if we, for example, set the detrital you to be 0.3. And in here like five, we can, This doesn't like, you can't really gauge
how different that is, but it adds a little
bit of variety. So we can also select the volume 0.2 multiplier and
Swann to be three. This one was very low. This one was very high. Pick aka stop. There we go. This
is the modulator. Modulator. We have the quality level, the random which we
talked about, the switch. That's very nice so you can
select between multiple ones. We've seen the switch, and let's finally talk about one
that is the Doppler. So if I go into the
Doppler and add this one, we can create a Doppler effect if you don't know
what the Doppler is, let me explain it to
you are very fast. So let's say you have an
ambulance coming towards you and an ambulance
going away from you. Both of them emit sirens, but you hear those sirens
differently. Why is that? Because the ambulance
that is coming towards you is admitting
the sound waves, but because of the speed of it, the sound waves are, sound waves are getting stuck together and they are
route and arrive to your ear more compressed while the one from the
ambulance that has going away are slowly getting decompressed
Soviet differently. This is very useful if you, if I have a car or
you want to create a realistic sounding ambulance, this can be very helpful with all of these out of the
way To be honest with you, like sound cues are, for me in this course at least are not going
to be that important. So if you are interested, this is a bit of a challenge for you to continue the exploration. Use the following link. It will be also available in
the resources if it's not simply search for sound that you reference in the
unreal documentation. And you will find
everything that you need. Look through the other
nodes and the balance and use them and
see how they work. If you are interested In tweaking your
audio to the maximum, you can do so many
fun things with this. I do recommend if you're interested in going
through them. But we are going to delve deep. We're going to focus more
in the next video on the attenuation because that's where we can really play around. Was like at a distance. So thank you so
much for watching. Just go explore if you
see interest in all your, and I'll see you. The next one.
55. Sound Attenuation: Welcome back, My favorite
game developers. In this video, we
are going to be learning all about attenuations, which is really, really,
really cool concept. So if I select this
guy right here, and we select override
the attenuation and we decrease the
fall off distance. If we are standing
outside of the circle, we can not hear anything. If we step inside of it. We can start hearing a bit. And the closer we
get to the source, the higher the sound
gets until we are finally inside of the circle
and weekend fully hear it. We'll see how we can change
lots of things in here. Some things you
might think, Well, Michael probably doesn't know. Well, Michael doesn't. I'm not a super expert and
playing around with all your so let's not waste any more time and
let's get started. Okay, so now let's focus ourselves on the
sound attenuation. Sound attenuation is a
setting that can control the various aspects
of how a sound behaves over distances
relative to the listener. And usually the listener
is you, the player. Let's talk about attenuation. This section defines how the
sound volume is going to be reduced so over a distance. So let's grab one
of these sounds, maybe normal or q, that's just add one of the
sounds that we have and the sound wave will add
the starter music here. Yep, seems to be good enough. We're going to override,
override the attenuation. Once we click on it, you'll see that we have many, many, many, many, many options. Now the first thing
we're going to talk about is obviously the
enabled volume attenuation. If this is not on, you're not doing anything. Next, we have the
activation functions, as you can see, we
have many of them. So I decided to create a slight function to make you or help you
understand button. First of all, we
have the linear, this is the default function. When using this function, the volume will
attenuate linearly. And so the change in
volume is constant as the listener moves towards
and away from the source. And by the way, let me just, you probably seen this, but if you didn't pay too much attention
inside of the circle, there is no attenuation
inside of this inner sphere. While I outside of the sphere, there is going to
be attenuation. Let's see if we can maybe just trigger this or
if you play the game. I don't know if you can notice. Maybe if you play it on your PC, you can hear it. You can faintly, faintly hear how this is
going to change. Next we have the logarithmic, the change in volumes
are greater at a closer distance and
less at a far distance. We have the inverse. This function is good for
sounds that only needs to be just alterable at a
very far distance. But that gets
significantly louder as the listener
gets quite close. As you can see, it
never gets to 0, so it's basically infinite. Next we have the log reverse. This function is good for
sounds that need to be loud across large distances. We have the natural sound
dysfunction attempts to model a very naturalistic
fall off behavior to produce something that is
more close to reality. This function is
the middle ground between the logarithmic
and the inverse. As you can see,
it's a competent, it's like a combination
of both of these. And finally, we have the costal. This allows you to find
your own custom functions when none of the ones are provided are sufficient
for your needs. You can see that it's
similar to the way we change the timelines and what in that, let me show you that we can add points by holding down
Shift and plus the record. You can see we can change
how the sound changes and how it behaves as
we changed the various, I don't know, set points, changing how they behave from point to point and all
of that good stuff. Next we have the
attenuation shape. So currently it's a sphere, but we can select a capsule, as you can see, now
we have this capsule. We have the capsule radius, which we can increase. There we go. You can see, so now it's, everything inside of this
capsule will be the highest. Next we have the box. This is very good if you
ever want to put the sound inside of a room and you don't want to go outside of that room. Next we have the cone. The cone is really nice
because the conc is useful in situations when you want a directional
attenuation better. For example, a public
address speaker, if you, for example, want to create a game that
is centered around a, I don't know what like
a very totalitarian. Environment or country. You can then create this slide
sound which allows you to, let me show you
like for example, everything outside
of the circle. If you play the game,
you can't hear it. We can hear it at all. So let me, let me try to
move this slide here. When we play. There we go. We can see that inside the cone. And the farther we
get from the comb, the less we hear of sound. Let's, let's try to
move this like this. Now you can hear
how it's barely, barely, you can barely
hear the sound. This is very cool behind this, you will not hear anything. Anyways, let's take this
back to the regular sphere. This is the most used one. Next we have the inner radius, and obviously each
of these shapes have their own way of
changing the radius. For example, N. Keep in mind
that the inner radius can change and that also
changes the outer radius. So if we zoom out, we make this smaller,
we make this bigger. And we also can change
the fall-off distance. And this property
defines the size of the outer area of the
attenuation shape. This is the same property regardless of the shape
that is measured from the, regardless of the
shape that we have. And also it is measured from the edge of the
inner to the outer. There we go. Next we have the
attenuation specialization, which is right here. Obviously we have the collision, the sub-mix, the reverb. Honestly, I don't know
what all of these do. I have never dealt that
deep into how they work. They are more advanced, but let's talk about the
space utilization of it. This section defines how the sound will specialize
and the game world. You can choose the method of specialization that
best suit your project, as well as experiment with
different settings for how your sound will behave as
the listener moves away. You can see that we have
the planning, the binomial. I think this is the only
place where we are going to change things up and
play around with them. That's basically at
all about attenuation. Obviously, as I've
always told you, if you want to go deeper, I really do recommend that changing and playing around
with Odeo can really, really, really
enhance your game. Don't take it lightly. Happened in here. Did I call something
anyways? Okay, great. So why are you doing this to me? Obviously there's
something wrong, okay? Anyways, finally, let's talk about actually creating
an attenuation asset. The content. We're going to remove this
and we can right-click. And in the sounds we can
create a sound attenuation, let's call it the sound
testing sound attenuation. If we open this up, you can see that we have the exact same settings
that we had previously. But the power here is
that, for example, let's say we don't
want to upper-right this we can simply use the
testing attenuation sound, which will take all the
properties that are here. Whereas, where would that be
very useful if, for example, we have multiple objects of or multiple objects or actors
in the world that want, that you want to exhibit the
same sounds over and over. This asset can be used and set to all of them
without you having to go into every single one
and changing and setting the same details all over again. Finally, I'm going to issue a challenge that I
will not do with you. It's a pretty simple one. Simply create a separate
platform to add sounds on it. Apply the different functions with different
attenuation shapes. See how all of that changes. Make sure the sounds are
looping because you want to keep hearing the explosion
if you have an explosion, also play around with this
specialization method, the binaural and the planning. And depending as you can see, how much I really don't understand about
all of this music, as well as because we
will be using them later. And also some differences
may not be clear. Keep that in mind and news
extremes whenever in doubt. Take it to the extreme, see how that changes up things. So with that out of the way, I hope this section
wasn't too boring. To be honest to me. It was not going to lie to you. I'm going like completely
honest as much as I possibly can because music was
never my expertise. I liked it even
less than material. So thank you so
much for watching. Now, don't get me wrong. I love adding sounds to my game, but I don't like tweaking
them by playing around with attenuations and adding
them in the sound cue. Maybe because I never
really delved into that. I just have somebody that
does it for me anyway. Thank you so much for watching. See you in the next one.
56. Section 12 - CyberSpy 3027 - Adding SFX to Our Game - Where, What and Who: Okay, So in this video we
are going to talk about the various music and sound effects that we are
going to use our game. I'll show you what I got. At least I'll show you
what I will require and where I got all of my
sound effects and music. And then I'm going to show
you the website where you can find your own sound
effects and music because you might
not like what I got. It's perfectly understandable. Let's talk about first of
all, the background music. Obviously every game needs some kind of background
music just to add a bit of excitement to the, our game is already
very exciting, but obviously we want
more excitement. Will have background ambiance. This is similar to the birds chirping and
the leaves blowing. So this is just adds a second dimension to the
level that you're playing gap. Plus, for example, the ambiance can be the
same four to three levels, but maybe each level requires a background music or
after you, I don't know, pick up a jam or move
over a certain area, the background music can change, but the ambient scan depend
on the environment you're in. So that's one thing. Next, we will get the
getting hertz sound effect. Obviously whenever
we get hurt by the spikes or we get
hurt by the enemy, we should have some kind
of hertz sound effect. Obviously, we also need
some kinds of dying sounds. So after getting
hurt multiple times, we have the dying sound. We have the pick-up
sound effect. Obviously we have the
destruction of the actor. Later on we'll be adding this
kind of like maybe we'll add a screen that lights up
whenever we pick up an item. But we also want
to have some kind of sound effect whenever
we pick up the jump. That would be very cool. We have the going through
the door sound effect. So now we haven't yet created the moving
through the door. That's obviously because we
didn't learn enough things, but we will do later
on in the course. Going through the door should
also have its sound effect. And then after it is done, and we move on to
the next level. Maybe also we can have like going through
door sound effects. You can add a sound effect that doesn't allow you
to go through the door. So it's like something. We have the platform
sound effect. Hmm. So when the platform
is moving in front of us, this is where we are going
to use our attenuation. This is where we'll use our attenuation while the
platform as far away from us. And as it gets close, we will be inside of the
follow-up distance and we will hear more and more the
humming of the platform. We will have the jam Hmmm. That's also be really nice, especially if you want
to create some kind of mechanic where the
Jenn isn't seen, maybe it's a bit hidden or some kind of
level where the gym needs to be found after a
certain amount of searching. The humble would be really nice. It would be very, very nice mechanic to add into your
game and agonize way to enhance your game using only the things that you know without adding anything extra. We will add a pressure plate sound effects when turned on. That's, that would
be really nice. The walking sound effect. So this is going
to be very simple, just simple footsteps,
tick, tick, tick that play whenever
we are walking, this will add an extra layer, layer of realism to our game. So the walking right now, not only do we sprint
and walk normally, we also move our head around and then we
will have steps also. I mean, that will be so cool. We have the enemy sound effect, the enemy as he is moving. This also can have
its attenuation. It would be really nice. Jumping sound effect. Whenever we jump out there
should make like a sound. Just to show that he's
trying to do some effort. We have the two landings on
the ground sound effect. You'll see it in the resources
that I provided you. We have two landings because
in this case I wanted to try out the sound cues just for the sake of using them and our game because we learn
them and I wouldn't want to just bury that and
information that we learned. I wanted to use it somehow. So the two landing sounds
who combine them in an ICU. Then whatever else
that you want to add, there is an endless possibility of things that you
can add to your game. I don't know what you
want to call them. You can have no
sound effects when you hit the small
spikes. Sounds of facts. When you hit the big spikes, you can have many, many, many sound effects
to your liking. Like it's all about where your
imagination can take you. Before I go, I wanted to
show you this website, which is open game r.com or.org. So this is a website
where I usually get everything that I
need for my game. Now usually this is more
oriented towards 2D art. The 3D art in here isn't that
great we honest with you. But still the good thing is
that all of this is for free. Now look at the cool part. If you select, for example, music and sound effects,
and you search, you'll find that
you have over like, I don't know how many in
here we have four by 3456, so six by four. Like we have hundreds and hundreds of sounds on all of these can be used in your game. Now keep in mind if you
ever want to put your game out there on a store
and have people download and start
making money out of it. You need to make sure that you
understand these licenses. And here, now, the
best one is the CCSE, which means that you don't
need to mention anybody. And the CC by three. And this one, and some of these require you to
mention the artist. It's fairly simple. You can also contact
the artist of the sounds that you
would like a lot. I'm just asked him if he would mind if you just use a
sound or maybe you can pay him something
symbolic or give them a very small percentage
of your games revenue. So that's what you can do. Anyways, you can see right
here displaying one, okay, So 8,391 sounds thought. Some of these look, you have 50 RBG sounds inside this one, so it's much more. I think you have over
16 thousand sounds. And this library, you can
download any sound you want. You can find any sounds you want and you can use it if you want. You can also maybe go like do some kind of website
other than this, just type in sound effects and just get yourself
some sounds. Great. So with all of that
out of the way, I'm going to issue you
a small challenge. So get yourself some
music, compile, compile your own list of things you'd like to
add to your game. Get creative, get crazy. So don't just maybe you've
added your own mechanic. Maybe you've added
a double jump. That would be really nice. Goes through the sound
effects I provided you with and see if some of them
are not to your liking. So maybe Unlike, to
be honest with you, it took me like around two or three hours and just do a three-hour
to find the sounds. Like for me, it's just like whatever it cuts the
bill, just go for it. Maybe you wouldn't
plug these sounds. Let's go find your own. Go through open
game art and find yourself some of
the sound effects either to replace mine or for the ones you want
to add to your game. So with all of that information, thank you so much for watching. I hope you enjoyed
the video and I'll see you in the next
one where we'll be actually adding
things to our game. So see you then.
57. Making Sure SFX Work (Audacity): Hey, So before we move on to
actually adding the audios, I just wanted to go over a simple program that
will allow you to make sure that the Unreal Engine takes and the audio
that you send do it. Because sometimes I faced many problems whenever
downloading audio from open game art would like if it's not
the proper format, it would not work on the
Unreal Engine or whatnot register and the content
browser even in this video, I'm just going to teach you a small program or show you a small program
and teach you how you can convert any sound effect into the proper format
in order to get it. So these are the sounds of facts that I've provided you with. Let's say one of them
does not work and I know that a lot of
them will not work. If you go and Google
just Audacity. You can download Audacity. It can be, I think it works on both and all platforms on
Mac, Windows and online. You can download it. It's 100% free, it's open
source and it's cross-platform. Now, you don't need to have
any magical abilities. I use Audacity for
my voice editing. It's not the perfect program. Yeah, but still it's free. It's not even cheap.
It's completely free. You can download it. Once you've downloaded it, simply search for all
density right here. Once it's open. Let me drag it right here. So you have this screen. Let's say you have
one of your sounds. You simply drag and
the jump Example. Dragging the jump
once it's in here. So you can play that. There we go. This is the verb of the chunk. Then once you have it in here, all you need to do
is simply go to Export and Export As WAV. And once you click on that, it should prompt a
screen where you can save your sound as a WAV file. And the WAV file always, always works on
the Unreal Engine. So this was just a video, just a small tip to show you how to make sure that
your sounds or the sounds that you've
downloaded now unloaded can and will
work on the unreal. So as you can see, because I haven't plugged in my, my I like charger. The world is very
slow and lagging, but no worries about that. In the next video, it won't
be when I plugged my charter. So remember or density, download it, use it in case the sounds that
you have don't work. And you can also do a lot of other things in the butt because the WM VWA v always works
on the Unreal Engine. So this is just a
small video with a small tip because
I've got, first of all, from my own experience, I know that a lot of audios
don't work in the unreal. Now everything I've
provided you with is WAV and will work, but just in case you
got your own sounds. This is a great tool to convert
them into working sounds. So thanks so much for watching. And this is the second
time, I promise you, but I promise you
in the next video, we will be adding audios. So see you then.
58. Adding The Audios: Welcome back. My fellow game developers do the longest video in history. So when we play the game, we can hear the background
sounds when we walk through, we start with the music. If we go near this, you can hear it when we pick
it up, we have a sound, you can hear we have
footsteps when we jump, we have a sound. When we learn, we
also have a sound. When we get hurt. There we go. When we turn on the platform. Next to the platform, if we're close to it
while it's moving, you can hear a very,
very faint sound. And finally, when
we die, we die. So let's not waste
any more time. This is a very long video. Take your time with it. Play around, make sure
that you don't get overwhelmed with the amount of time that you're
spending on this video. And you can even cut it out
into two pieces if you want. Do the first tab and
do the second half or just do it all at once. So thank you so
much for watching. I am really sorry
for the length. Let's not waste anymore
time and let's get stopped. K. So time to actually get
into adding our audios. So first of all, the content browser and
the content right here, this is where we are
going to set the audio. I'm going to go into the
file where we have all of our audios and simply drag
this audio folder in here. If everything goes through, right, there we go, we should see that we
have all of our audios. So Control S or Control
Shift S to save everything, or Control S PUT, just save what we
have in here or we can click this button
or this or whatever. So yes, safe. Next you'll notice I've added this little box right here
and the player start. Once we started the game, we can walk out of
here into our level. And this has a purpose because I wanted to
add a trigger box right here that will start
the background music. But before we do that, I want to drag in
the outdoor ambient. There we go. So this will
be our outdoor ambient. So now when we play
the game, there we go, You should hear this kind
of waterfall and whatever. I just got this randomly
from the website. So it just for funds. So we can set this sense. It doesn't have any attenuation. You can set it wherever we want and we can maybe tweak it, but I don't think
it's the details. That's why I didn't
find anything. We'll set it at the
zeros, zeros 0 location. So Control S. Next we're going to
add a trigger volume. And by the way, I
know this video is probably very, very long, but it's okay
because we're adding all of the sounds and
one single video. Once we cross this, I want to play the sounds,
the background music. So I'm going to make this box
just a little bit bigger. So we make sure that the player, no matter what happens, will cross through this. Move it up just a little bit. Now we'll go to the blueprints, open the Level
Blueprint in here. Let's just, let me
just delete these. I'm going to right-click
called event on the trigger volume on the collision on
the beacon overlap. In here, we're going to make sure that it is the character. So gas through my character. The character from the
character I'm going to do once on this, do once. I'm going to play a sound, play, sound, play sound that I want. If we go back in here, select the background music, go back into the level
and just set this as the background music
compile, save. And now when we play the game, we have the background music. I mean the ambience. Okay, great, So there we go. This is our sound. I'm just going to turn
down the music that I have on my B C
naturally know what, maybe we can just start turning this down as long as
we know they work. I don't want them to
really interfere me just some reason it didn't. If I open this up, I'll just set this to 0.5. That way we can still hear each other
whenever we thought, you know what, let's
set it to 0.2. So it's just a
faint thing points in the background
and this one also, let's set it to
0.5. There we go. Save, save, and
close these down. Next we'll want to add these sounds are
getting hurt and dying. So where do we die? Let's see. The my character. In the event of graph, before we quit the game, we are going to die. Before the game over. I'm going to play
sound at location. This is not a sample D
to D, by the way, i'm, I'm not sure if I
forgot to mention it, but sound to the means
it plays all over. There is no attenuation. It just like a sound
all over the world, just as it would
be in a 2D world. So there is no extra dimension. The location is going to be
on the get actor location. So get actor location. This is where we are
going to play the sound, the sound that we are
going to play if we go back in here and the audio, we have the player debt. There we go. Click on the player dead and select this
little arrow in here. So I'll compile, save. And in the game, Let's
add these spikes. Oh sorry, the audio spikes, Let's add the death spikes. So play the game. But the problem is,
as you've noticed, that we don't hear
anything because we quit the game immediately. So before we quit the game, we are going to delay. And this is why it's so important to always
test things out. I'm going to add a
delay of 1.6 seconds, you know, 1.6 seconds because
the depth sound right here. This has gone to
be a long video. Anyway, if we hover over it, you can see that the
duration is 1.6, so we have enough time to play. Now this presents another
problem is that there we go. It takes a bit of time and weekends still keep on walking, which is not good, but don't worry about that. We will fix it later on when
we learn a multi-arm G, because obviously
when we lie with Antoine to quit the
game immediately, we're going to go
into some kind of like spas video bypasses
positive view mode. And there we will
have the option to either restart the
level of the game, so that will be handled
later on. No worries. Next we want to add the
hurting sounds so in case we don't die after event,
take any damage. So in here we are
printing out and before the delay
we're going to play. And actually, you know what, let's just copy this. Put it right here. And we are going
to play sound at location which is
going to be the hurt, hurt, what's called or damaged. Getting damaged. So Compile, Save. When we add the
spikes. There we go. So now we played the
game. There we go. You can hear this small tick. There we go. So we can hear this little getting heard sound. I know it's not much, but it does the job. So next thing we're
going to do is we're going to issue you a bit of a challenge to add
the following audios. So when the jump is picked
up, that's important. When the pressure
plate is triggered. When we go through the door. When we jump. Also add an audio
component to the enemy, the player controller
and the moving platform. These are all important
and make sure it moves, moves the object. So make it a child of the
component that is moving. So that's very important because all of these audio
components will be based or will have their attenuations
played around with me. Make sure that the bars, the video right now, The Golden the challenge. Okay. So how did you
get on with that? I hope it wasn't too hard. In the Content Browser. We're going to go to
the FPS and open up the player controller because I believe the player
controller is where we jump. Is it about what did
we have in here? Okay, So this is the
Start, Stop camera shake. Next we are going to go into, whereas the jumping, we
have a lot of things in here that are not done
very properly sold. The movement, the
jump, the jump. I'm simply going
to play a sound. Play sound. We complete either sound to
D or play sound at location. It really doesn't really matter. I just want to make
sure that, you know, all the different ways
we can play the sounds. I'm just going to keep it
simple and just a jump. So I'll compile, save. Now when we play the game. There we go. Now the problem is, is that if this
is not very good, we do here this jumping sound, but we don't want to
keep hearing it if we are already up in the year, we want to make sure that
when we are on the ground, then we can only hear the jump. So what I'll do in here
is I'll create a branch. That branch condition
is going to be if we are on the ground. So I'm going to
grab my character. I'm going to get the
character movement. From that character movement, I'm going to check
something that is called, is moving on the ground. If we are on the ground, if that condition is true, then we are going to play
the sound compile save. And if we play the game, if we press it multiple times, there we go, we fixed
our big problem. Excellent. Now the next thing is the jump being picked up and the pressure
plate triggered. So if I go back in here, this is fairly simple. If we go to the
gym, that's fine. The jam, open up the pickup jam. Saw before we destroy the actor, we are going to
play a sound sound. And hopefully this will
not be destroyed with the player with the jam. And we'll see if that does. So we're going to
write in here jam, jam backup, compile, save. When we play the game. There we go. So
now we are able to pick up the jam and it
sounds pretty nice. What else do we have? The pressure plate that I call it brush pen that
I can trigger plate. Let's just call it plate. Activation plate. Okay. So activation plate,
when we activate, do once, set the material
and the play sound. Play sound to the
what is it called? The plate? Let's see, pressure plate. I call the pressure plate. Well, it's based on the
players pressure on it, so it makes sense. Let's save everything
and let's play the game. Excellent. So as you can see, now we have the pressure
late working properly. Now before we move on, let's close down
the pressure plate. We won't be using it. And what else do we need to do? Go through the door. The door is what we
are going to do next. In the door. Let's find the exit door. I know this is a long video. So as I've told you,
you can either create a SAP or you can also create a sound to whenever we are not able to
go through the door, but I didn't go to that length. I really forgot about it or
didn't really want to do it. I don't know why. The exit door, exit,
Let's see door, open door, sound effects,
regard, compile, save. And I'm going to go to the other end because
we don't have the time. Also this all by the way, I think this will only work
if we've actually yeah, this will only work if we actually can't go
to the next level. I'm just going for
the sake of testing, I'm simply going to let's
just keep it in here. I'll just drag the jam that we have all the way to displace. Now on the play button, you can see that we have the option down here
to either play on the current camera location or on the default
player stopped. The player start
is way over there. Just for the sake of testing, I'm going to select the
current camera location. Play. Pickup this. Now. There we go. So you can hear how
the door opens up. How cool is that? Next thing we're going to do, let me just change this back
to the default player start. What else do we have to do? We need to add the components to the enemy player controller
and the moving platform. The exit door is done. The pickup jam isn't done. We needed to add one to
the pickup gem, right? I forgot to tell you that
we need to add one to the pickup jump because we obviously need to
have the humming. That's okay. Please don't be angry at me. So let's add an audio component. This will be the jam. Hm. This jam Hm is going to be the sound gem, humming,
compile, save. But for now, we're not going to actually play it because as
soon as we start the game, we are going to hear it
from a very far distance, which is not very good. So let me play. You can hear this is the
sound of the jump, but obviously because it
is all over the place, it doesn't choose attenuation. We can hear from
anyplace in the world, which is very, very bad. So I'm going to select
the jam for now just said The whereas the auto activate
two off, just for now. Next we're going to go
into my player controller will add an audio
component in here also, this will be the stepping, maybe as it steps,
sound, hit Enter. We'll also get the moving
platform and the enemy. So the morphing platform, we'll add a component on
the moving platform ground. So add component, the audio component, the platform humming. The sound on it is
going to be the hmm, see platform home,
compile, save. If you play the game. Go. You can hear this little like some kind of soul
in the background. The platform humming. I
know this video has been, I think we're around
16 minute mark. I'm very sorry about
this is what we do. Now. The platform humming
isn't just going to work on all on its own. We're going to make
sure that it only works once we have it activated. So after the set
activation right here, we're going to drag and
the platform humming. We're going to check. That's move this
up a little bit. Just to give it some
breathing air in the ear, we're going to check and
set the volume multiplier. If it's off, we're
going to make sure that the volume multiplier as 0. And if it's on hold, excuse me. If it's on, then
the volume is one. And here we are going to
drag this, so compile, save. And now we should see that we don't have any homing
once we turn this platform. Okay, So that didn't
work. For some reason. If we hit the F8
key and we check on the moving platform or is
it the moving platform? If we scroll down, we don't for some
reason do why do we not have we do have it in here. And the volume multiplier, volume multiplier is one, but we don't hear
anything for some reason. Well, let me check
what the problem is. Okay. Welcome back. So again, after searching for
this for like ten minutes, finally I realized what
the problem is and it's something that we
were going to do later on, but I thought that it can be
postponed, apparently not. So if you click on the platform, you'll see that it
should be looping. Why does it, why should it be looping and why is this a
problem when we turn it on? Well, because the
entire sound around, like the duration is 7.5
minutes, 7.5 seconds. Apparently whenever we are
setting it right here, it's playing while
the volume is done. Once we turn it on,
it's not working. So now I didn't change anything. You can see that they are
exactly in the same position. Everything is the same. The only thing that I changed
as I made sure that the platform humming looping
once it's sloping. Now we play. Now we went, when we turn
this on, there we go. We can hear it and
the background. Now. The things we need
to do is turn on the looping on the background music. Turn on the looping
on the jam humming. Turn on the looping that I
saved the background music. Yes, Control S, getting
damage, the outdoor ambience. Turn looping on this also. I think that's all
we need to do. Yep. I think that's it. So sorry for that mistake. I I like for some
reason I was so confused because
as I've told you, I know that this should work
and I was like so perplexed. And the other problem
is that when I used to turn this on
the platform at work, normally solve it was like what what's happening
when I change the volume of the multiplier on the platform humming
it worked immediately. I was very confused. But anyway, what
else do we have? So we've added the
platform humming, we've added the jam humming, we need to add the
the player character, we've added the jumping, and now finally we need to add the landing and the walking. So let's go ahead and do that. First of all, in the walking, we're going to go where
we have the camera shake. And from here we are going
to create a sequence. From this sequence,
the first one is going to reset the first ones we're going to add the
same thing in here. Bam, there we go. And reset this one. The second one we are
going to get the steps sound and we're going to set
the multiplier on each one. So set the volume multiplier. We go. There we go. And we'll set the
target in here. So if we stop shaking,
we're going to set to 0. And when we start shaking, we're going to set this to one. So Compile, Save and as
the audio steps set up, Nope, that said the steps. Steps, walking. Sound wave for the walking. Let's see. Right here is
called the walking. Yes. It's a very faint sound. I think maybe we should play. Nothing is heard. Let's increase
it sound of the Walking. Maybe we should also
set it to looping. I don't know. Let's try to increase
the sound to like five. See if that works or if
there is another problem. Or maybe we should
set it to looping. Looping, see what
happens. Okay, great. Now we can hear the steps, but the problem is that
when we are running, It's the same thing. So we're not actually
hearing anything when we're walking,
when we're running. So we'll go, we'll save this, keep it at five,
keep it at looping. And then on the
player controller, when we sprint, whereas the
sprinting cause movement. Whereas the sprinting. Where did we set the splinting? Okay, there we go. So
this is the sprinting will add steps sounds in here. And this time we're going to
set the pitch multiplier. The multiplier should give us that nice effect of us running. We'll set the target
in here also. This is a bit
squished, no worries. Which multiplier when we were
just walking should be one. And it depends,
maybe you're walking speed is a bit higher source, set it to your liking. And then when we're running, we're going to set this to four. So let's see, compile save. Okay, Sounds great. Actually we might
want to make it maybe five in here. There we go. So compile, save. And now we should hear. Excellent, I'm very
happy with all of that. The last thing we
need to do is we need to create some attenuation. Also the landing,
also the landing. In the landing, I'm going to right-click and
go to the sounds, whereas the sounds, sounds
create sound attenuation. This will be the
blending sounds. Notice it's not the attenuation, this is the q underscore pew. Sound attenuation. Oh my God. Sounds. We're going to
create a sound cue. And we'll use this name
here, this one here. And let's just delete this one. Delete this. Keep the sound cue. I was confused like
what's happening in here. I'm going to set this up. We'll select the land one, right-click and we'll add the
wave player for the sound. One will select the
land to go into the landing cure right-click and select wave player
for the land to. This will be our landing sound when we hit the
floor after jumping. In here, we're going
to create a random. Random. This way we'll
keep things fresh. And after the random will
also create a modulator. This way we'll change the modulator from the
pitch sound being 0, from one, with a pitch sound
maybe being 34, maybe. 0.8 to three and the volume
mix is going to be 0.823. I don't even know how how this will sound like if
let's hear sounds, try to play the queue. So obviously we need to
increase this old 0.08. Sorry, I was wondering
like why is it? Okay, great. So now when we play the game, we haven't attached to it yet. So we have the sound
cue in here prepared. And when we land. So how do we know
when we learned? It's pretty easy because we have something called the event land. So when we land land on the van plan on land
event, can I find it? I can't find it. So this should be
from my character. So let's get the character. Maybe we should do it here. Actually, let's make
it in the character. Why not? It's far easier. Saw on land, on event
land. There we go. We are going to
play sound to the, which is going to be the
sound cue that we have. Landing sound, Q, compile, save. And now when we play the game, this will be fun in
this case when we jump. Regard. So now we have
a bit of like honestly, I wouldn't use the landing
zone in any other case if it wasn't just for the sake of
using a sound, the queue. Now what do we still have? We have the attenuation,
Yes, the attenuation. So this is the longest
video in history. Back in the sounds,
the sound attenuation, this will be the score. And the mistake that I made
couldn't help it too much. So I'm going to open up
this attenuation and we'll just do a couple of things
in here that I already know. The attenuation function is going to be the natural sound. If the attenuation is going, shape is going to be a sphere. The inner circle
is going to be 80. The outer circle is going to be 1500s that we're only when
we are very close to, we hear the hummingbird
of the various objects. So the specialization method
is going to be by neural. That's it, I think so apply, look back at the settings. If you're not sure
or if you want, you can experiment with
your own settings. I do recommend that. Let's maybe add one
neural radius of maybe fifty one
hundred and eighty, one hundred and ninety. I don't know. Let's just
add 180. See what happens. Save. Let's go into the
platform humming. So on the pickup jam, on the jam hmm. We're going to
scroll down until we find the attenuation and we'll select the
humming attenuation, will make sure that it auto
activates, compile, save. And now when we play the game, we didn't hear any of
that because I think we turned off the
gem harm right here. There we go. So when
we turn it back on, this is the radius that we have. 150,500 is a bit
big, but anyways, okay, So sounds good enough. I think maybe shouldn't be
tweaked a little bit more. Now let's go to the platform. The moving platform. The content that I'll click open it up in here,
the platform humming. If we scroll down, we should add the attenuation. Know what I think. Let's just keep this
at 0 as it was. Save, think we did some
mistake when I changed that. Something is not
compiled in here. Let me compile save. So the platform moving
or K And what else? Oh, we forgot above the enemy. So many things to
do so little time. So the BP enemy, I'm just going to
go ahead and add the audio and add it to the
enemies bodies so it moves with it and the enemy
will select the sound. Enemy. Nope, can't be that easy. Need to go back
into the audio and check for the where is it? Where is it? Where is it that walking,
jumping, getting damaged. I'm not add a glue. Goodbye that I had
an enemy sounds. While should've done that. Anyways, we'll just select
the regular channel hmm. I think that will be enough. Jam humming. The attenuation is going to be the
one that we created. Compile save finally,
the moving platform, everything should be in place. So when we play the game, okay, there we go. Maybe we should make
this a bit bigger. Yeah, I think we should make the attenuation on
this one a bit bigger. If we go to, we have so many tabs right now. So we'll open up the attenuation
and make this maybe 300. Save. Okay, there we go, so we can pick it up. And now when we hear that. Okay, Excellent. So guys, girls, thank you
so much for watching. I hope you enjoyed. I know it is longest
video and trust me, I've been at the
longer than you have. We made some mistakes, mistakes, we learn
from our mistakes. I hope you enjoyed this video. Thank you so much for watching. See you in the next one,
and congratulations now, our game is much
more fun because of all the audio
that we've added. See you. The next one.
59. Section 13 - Unreal Motion Graphics UI - Widget Blueprints: Welcome back, my fellow
game developers. In this video, we are going
to be learning how we can create widget blueprints
and the overview, these widgets, widget blueprints on my guy like and
talk over our screen. So now when we play the game, you'll see that we have these four images on the
screen for some reason, even though they are
not part of the game, they just move around. And this is the essence of game development or
actually any game in displaced things
to the screen. And we're going to
learn how to do that. So let's not waste any more
time and let's get started. Okay, so time to learn
about widget blueprints. So in order to start working with Unreal motion of graphics, which is called the UMG, we need to first understand
and create widget blueprints. So first of all, this is annual level. I've created that from
the File new level. This is called the
widget testing. It's completely empty and we
don't need anything in it. So we're going to open up the content browser
that we have in here. We're going to right-click
in some kind of anti space. And we are going to go to the user interface
and we are going to create a Widget Blueprint. So once the Widget
Blueprint is created, the Canton browser will
close for some reason. And we are going to call
this the BP underscore, underscore widget,
chipped testing, open VBP widget testing. And here we are. By default, the Widget
Blueprint editor opens up on the Designer tab. This is the Designer tab. The Designer tab is the visual representation of the layout. And we'll give you
an idea of how the screen will appear
inside of the game. Why is this called the designer? While I'm glad you asked, because if we go
to the top right, we also have something
called the graph. If we click on it, There you go. You can see that we
also have a way to code inside of our UMG or
our Widget Blueprint. But let's not get
ahead of ourselves. Let's go back to the
designer and let's talk about what we have here. First of all, we
have a menu bar. It's a very common menu bar. We have the toolbar. This constraints the number of commonly used functions for the Blueprint editor such
as the compile the same, and all of these
other fun stuff. We have the editor mode, which is on the top right. This is called the editor mode, which switches between the
desire designer and the graph. We have the pallet
on the left upside. This is the list of widgets that you can drag and drop into the visual designer also
displays a common classes. So as you can see, we have
the buttons, the slider, the texts, and a lot, a lot of, a lot of other things. Next on. Next in here, sorry, we have the hierarchy. This displays the parenting
structure of the user widget. You can also drag widgets
into this window. So for example, if I add
a button right here, you can see it's added. And if we add a checkbox
under the button, you can see that there is a certain hierarchy to
the widgets that we add. Right here. Next we have the
visual designer. This is the visual
representation of the layout. We've already talked about that. Next we have the details. If I click on the bottom, you can see that this displays the various properties of the
currently selected widget. And finally down
here you can see that let me delete the compiler. We don't need it. We
have the animations. This is the animation
track, the UMG, hence why it's called UMG, which is unreal motion graphics. So there is motion that
we can add to this, and we'll learn how these
animations work later on. Now, let's talk a bit about the visual designer
that we have in here. We'll add a couple of things. And the, and in the
upcoming video we'll be delving deeper into every
single one of those. First of all, let's see. If we hold down the
right mouse button, we can move around. If we scroll with the
mouse button back, we zoom out and if
we scroll down, we are zooming in. Very nice. We can also hold down both the left and
right mouse button and move them up and down
in order to zoom in and zoom out very basic things. Next we turn, we can turn
off and on the outline. Now this is based before. This is not very important
because it will let you or allow you to choose the language that will be added will not
talk about that too much. Next, we have the outlines. As you can see, we can turn
on and off the outlines. Next we have the slug. So for example, if we
have a button in here. Let's say it's like that. We can lock it, which now makes us or does not allow us to choose this button. If we turn off the slog, as you can see, turn it
on one of them respects. There we go. Even though this is locked, now we can move the
button around even though it's slightly
because this allows us, as you can see, enables or
disables respecting log. Once we lock it down again, you cannot move this until
we unlock it right here. Next we have the layout
and render transform. So this is a bit
tricky because depends on how the object is
inside a certain widget. So right now we are using
the widget layout transform. If we select the widget or
the adjusted widget render, you can see that we can
start moving this around. Well, let me show you a
better, better example. For example, if we
have horizontal box, I know this is very advanced, but keep with me this
is a simple example. We'll add a button into
the Horizontal Box and we'll duplicate it three times and we'll make
sure that they fill. Okay, So currently
if I hold down this on the adjust widget, you can see that I can move it outside of this
widget completely. And we are left with
only two buttons, and I can not move
it back and side. I have to do it manually here on the horizontal box and fill it. But if we are in the
render mode now, I don't think that
was clear enough. Let me now, as you can
see in the render mode, I don't move it outside. I just hovered over
and then that's it. So there you go. These are the basics of using either the transform layout
or the render layout. Now ninety-nine point nine
percent of the time we won't be using the
widget layer transform. Anyways, I know that was
probably very confusing, but There we go. Next we have the snapping. So just like we have the
Unreal Engine in here, for example, we can remove all of these snapping completely
and move it around. Or we can add snapping, for example, to make
it well snappier. Next we have the Zoom To Fit. So let's say we are right here. We click on the Zoom
To Fit and bam, we are back, baby. What else do we have? Let me delete this bottom. We have the switch between
landscape and portrait. Well, if you look at the
right, let's talk about these. First of all, we have
the screen size, so we can use one of these devices to determine
the screen size. You can see right here,
it's 1280 by 720, which is 69 ratio. If we select a
phone, for example, the Apple iPhone seven, and we switch between
landscape and portrait. You'll see that it is
right now a portrait. If we switch it like
this, It is landscape. In here, as you can see, we can switch between those. We can select 700, which was our previous usage. Let me zoom back out. Next we have the flip,
the current saves all. Now this is a bit advanced, but basically the safe
zones are designed to keep the UI from the splaying
somewhere that is, or can technically be used. But the player can see, as I've told you, this
is a bit advanced topic, will not be delving
too deep into it. And finally, we have the chance to change this
from filling the screen. So this will fill the
entire screen of our game. Or we can select
a custom screen. So custom that regard, we can set the width and the height or we can
set it to desired. This is most likely will be used whenever we are putting a widget inside of another widget. This is very helpful. Let's take it back
to the full-screen. And now let's go ahead
and really test this out and see how it
might look AND gate. So I'm going to add
an image right here, make it yea, big, compile, save. And now if we go, What should we be playing? We go into the game mode. Let's see what we're using. My game mode. So
third-person character, okay, let's find the Actually
we don't think to do that. I think we can find
him right here. So if we search, open this guy up, the event graph, whereas
the beginning play, whereas the begin play. On Begin Play. We are going to create a widget. Create Widget. And the
widget is going to need a class which is the BP
underscore widget testing that we just created. And we're going to
add two viewport. There we go. And target that
we want to add is the widget that
has been created. So Compile, Save
back in the testing, we play the game
and there you go. You can see that we have the
image that we've added in the viewport or in
the Widget Blueprint. With that out of the way, this was a bit of
an introduction, obviously later on
we'll be delving into every single one of
the aspects right here now. Obviously not every
single one of them, but the most commonly used. And we'll understand how all
of these work and how we can tweak all of the details
and properties right here. But until that happens, it's time for you to
learn on your own. Now you are experienced, experienced, it's time
to explore on your own. So add an image to the widget. I've already done that
at a text and white, something to the screen. Experiment with text color, font and font size. Add horizontal boxes and
put everything inside. See how that changes things
up and add a vertical box and see how that makes things also and also try to change
the image colors, try to play around, just try to explore, have fun, thus things out. I'm not gonna do the
challenge with you and let you learn on yourself. Just imagine if you didn't
have me, what would you do? Thanks so much for watching. Congratulations on making
it to the section. It's super important
that you did give yourself a pat on
the back gravel. I recommend you pause
the video right now and go to the challenge, and I'll see you
in the next one.
60. Understanding The Basics: Welcome back, My favorite
thing developers. In this video, we are going to understand the very basics. We're going to learn about the root component
that we have in here, will learn about the Canvas, his role, whatever it is, will also learn how we
can resize certain boxes, how we can add sites to content, understand everything in
the slot canvas panel and just like layout, the grounds for us to
build up, build upon, to understand more and more of the widget, the UMG interface. So let's not waste any more
time and let's get started. Okay, so in this video
we are going to be understanding the very basics of what we have in
this blueprint Widget. Blueprint. First of all, let's make sure that everything is empty so we can
start off fresh. So I'm going to compile, save, and make sure we
don't have anything weird. Now let's look at the hierarchy
and see how it works. It's pretty similar to the
way the components hierarchy works or the World
Outliner window works. And other blueprints. As you can see, as soon as we started or as soon
as we created, we already have
this root component and we had the canvas panel. Let's first of all focus on the root component
and then we'll talk about the canvas panel
and what its role is. First of all, you'll
notice that in the appearance we have
the color and opacity, the foreground and the padding. Let's say we grab
an image in here. So I'm going to
look up the image. If I can find one. There we go. We've added an image and you'll notice that the color is white. If we go into the appearance and we select the color opacity, we can change it
to red and hit OK, which is very good. But if we go into the
blueprint root component and we select the color and opacity and start changing it. You'll notice that the colors on the red star to change as well. Why is that happening? Well, that's because the colors get blended whenever you are changing one of the background
or the root components, appearance because
this is like a canvas and the color and opacity will determine all other colors. But keep in mind also
that a white color, which is this, will focus on or will be omitted
if you'd like. So now we can set the color
of this image solely through the use of the color and
opacity of the road component. Next, we have the
foreground color, and you'll notice that it has this little deck right here. And if we take it, let
me take this back to completely avoid so we better understand
what's happening. If we take it and go
back to the image. And we open up the brush
in here, for example, where we can also change the color and we
click on inherit. This will inherit
the color that is on the foreground of
the road components. So now if I change the color to, let's say read or orangey red wherever this will change
the color on the image, even though the colors of
the opacity and the color of the 10th are exactly the same if I tried to change
the color from here, you'll see immediately there's this little thick right here. Checkbox is unchecked. So these are just
the basic things that you need to
understand about how the foreground works with the other widgets that
are on the canvas. Now let's take a
look at the canvas. The canvas is always
added automatically, but you can remove it
or add your own again. And basically, all that it
does is it allows us for better handling
of the components will be one to place
in our widget. So I'll just go ahead
and delete the canvas. There we go. You
can see there are, there is normal canvas. And if we scroll down or
search for Canvas appear. So canvas panel we just
added, and then we go, we have a new canvas
panel that we've added. Now. Whereas the benefit in this, while you'll notice
whenever we add any object in here
and scroll up, you'll see that it is a slot
inside of the canvas panel. And we can have this slot be different than that
of a canvas panel. It can be one of the
horizontal boxes, one of the vertical boxes, all of that as possible. This allows us to set
the position, the size, and the order in
which these are sets. Or for example,
you'll see we can move the position
and that position is based on the anchor that we have in here.
Just wait a second. We will talk about anchors, the position y and
the size x and y. And all of these are based
in side of the canvas. So similar to what we had as a but parent-child relationship
between components. We have the same in here, between the canvas
and the bottom. The bottom is the
size of 902.1344. As a child of the canvas
panel that we have in here. If we, for example,
add an image, Let's not add it to the bottom. Simply added in here. You'll see that we have
something called the z order. And if we change, change
this to minus one, you'll see that now the image is rendered behind the bottom. And we can also change the
order in which the widgets are rendered on top of each other using the hierarchy right here. So if I move the image
above the button. If I move it below the button, this will not affect things because obviously
that's minus one. When I put it back to 0, if I move the button
under the image, you'll notice that the
button gets rendered on top of the image even though
the order is the same. But always the order that
is on the Canvas slot is more dominant
than the one that we have in the hierarchy. With all of that out of the way. Next, let's talk about the
anchors and what they do. Basically anchors, which
we can change right here. The find a UI widgets
desired location on a canvas panel and
maintains that location where the
varying screen sizes. You'll see that we
can set the anchor on different positions
of the canvas. We can even stretch it out to all sides and we can slot
it down to the bottoms, or we can slot it down to
two points in the middle. This is very important to understand and realize
how this works. It will also notice
that the positions being changed whenever we
are changing the anchorage. Because if we send the
anchor to be right here, you'll see that
the position x and position y are almost is 0. But if the anchor is set
to the bottom right, you'll see that the positions
are very, very different. And you can see right here, unless this one
work, I don't think. Let's try moving it down here. So you'll see right now
it becomes almost 0. So it really the location of your widget or the numbers that are determining the location of your widgets are based
on the Anchorage. Now I'm going to
issue you're a bit of a challenge for you to
test out the anchors, but something I
forgot to tell you. If you want to play around
with the screen size, all you have to do is simply
play the game from here. And then you can
select this window and start making it
smaller and bigger. There we go. This is how you can play
around with this screen size. And you'll notice how
these are changing. They are either on
top of each other, they are far away. What is going on? Well, that is for
you to find out. You'll need to test
out the anchors. First of all, please,
the anchor of an image in a certain position. Then run the game and resize
the shape of the game. View. Try another anchor
and do the same. See how it changes. Test out the anchor. You are not sure how it
would work if we change the screen size and anchor the image to the middle
and set the position to 0. This is very important. Is it centered? I don't think so. Set the alignment to 0.50.5 on the x and the y and see
why it wasn't centered. So another thing I wanted to
add, I just thought of it. You can add several
images and anchor them to different positions
and then try to test out changing the
size of your screen. See how that impacts. Maybe it will help you
understand things better. So pause the video right now. Go to the challenge. Okay, so I'm going to
delete the button for now. And I liked you a bit because we don't
need to run the game. We can actually
change the size of the screen from within here. You can see that
when the screen was the normal size that
we had all along, let me zoom out a bit. We can also move it
down so you'll see how the anchorage affects
the way this Canvas. You'll see that when
I move horizontally, nothing happens. Let me just double-check
what the anchorage was. If I set the anchorage, for example, to the right. Now when we move right,
Nothing happens. When we move left,
it moves left. It stays the same distance. If we move down, it also isn't that effective because
it's in the middle. What happens if I set
it in the middle? While you'll see it keeps
shrinking with the image, with the movement of the canvas. Let's try to set
it on all sides. If I start it on all sides, and if I can get
a handle of this, so there you go, you can see it shrinks and moves with the size, whether it's on the X or the Y. It's a bit tricky to really understand what's
happening in here, but this is how the
anchorage work. So for example, if we set the
image here, there you go, you can see it's shrinks
with the x and y because of the anchors that
are on top and on the bottom. And we can keep
doing this all day. But just know that this are the anchors allow us to maintain a certain size for the image whenever the screen
size is changed. And last thing I wanted to
talk about in here was this. Okay, So men, these
sites to content. Now it's best demonstrated
when we are using a text. As you can see, I can
make this box bigger, can make it smaller. But if I click on the
size of the content, the box around detox
textblock will always be the same as the
image that is inside of it. And if I select the text right here and scroll
down to the font, and I increase the
size of the font. You'll see that the box
will increase its size and shrink down with the
founder of the tanks, which implies the
size to competence. So that's all that I
have for you today. I hope you enjoyed these
basic understandings as we move through because I remember learning widgets
for the first time. They were very,
very weird to me. I started working with widgets and I had no
idea what's going on. I'm trying to as much
as I possibly can take you through every
single thing step-by-step. So we grow, we learn, and the more we understand
the last sphere we have whenever we're tackling
something that is maybe out of our hands. Thank you so much for watching. I hope you enjoyed the
video and I'll see you the next one.
61. Widget Organization: Welcome back, My favorite
game developers. In this video, we are
going to be learning about the various ways that we
can align our widgets. So we are going beyond
the alignment of the canvas and learning how
we can use the horizontal, vertical grid and uniform grid
and the widget blueprints. So let's not waste any
more time and then let us get started the case. So to this point, we've been using the
canvas panel to add an organize our widgets. But this is not the optimal
way to organize things, especially when we start having several
objects side-by-side. And we want to make sure
that the do not overlap and that they always
align together. So if for example, I have an image like this one, I duplicate this image
now I have another one. I wanted to make sure
that I align it. And if you zoom in, you'll see that there are inconsistencies and
it's not very fun. So we want to have some
kind of way that will allow us to align all of
these images together. Well, thankfully, if we scroll down and click on the panel, will see that we
have many ways of organizing our various widgets. One of them is the canvas panel, and one of them is
the horizontal box. When I add the horizontal box, there are two main ways
that we can add it, either by dragging it into the window or simply
selecting one of the image, right-click on it to wrap with and select the
horizontal box now, but it's wrapped inside
of a horizontal box. So I'm going to use
this one that we created and delete
the second one. Once we add this
image right here, you'll notice that
it is squished and if we try to move
it, nothing happens. Before we continue on, I'll select this image and
change the tint to read. Select the second image and
change the tint to green, and the third image and
changed it to blue. So now we have three
different images. So I'll drag the image
12, the horizontal box, and drag the green image
also to the horizontal box. Now notice that we have all of these three stack together
and the same exact size. I can select the green one and move it one
arrow to the left. And you'll notice that we have this organizational
power between them. You'll also notice that
if we click on one of these images and scroll up, we have this locked
horizontal box slope. It's no longer part
of the Canvas slot, it's part of the Horizontal,
Horizontal Box slot. And with it comes a lot
of different options. So if we click on fill
on the green one, you can see that it will take up as much space as
it possibly can. So it takes up all of this
space that is not taken up by the blue or
by the RAG one. And you'll notice on
the blue, for example, if we start to increase
the size image, it starts taking up
more and more space. So this is the actual
size of the image. It's 32 by 32, but whenever it's inside
the horizontal box, it simply takes in
whatever space it has. Because if we look on
the horizontal box, you'll see right here it
is film horizontally. If we click an or if
we remove the full vertically and set it to
center align. There we go. It just becomes a
picture of 32, Bye 32. Now when we increase the size
on the y and gets bigger, but it does not go
bigger than what is given to it by the box. So I'm going to fill vertically. Now you might be thinking, why is it not filling horizontally while
the green one is? Because we've set it to
fill while the auto well simply sets it to do
whatever should be done. If we select this one
and set it to fill, and select the red one
and set it to fill. You'll see that
these three take up exactly the same amount
of space between them, no matter how much we
change in these sizes. So let me zoom out a little
bit or use this one. Zoom. So now what should we also
understand about the filling? If we select one of the images, you'll notice that when
we click on the field, we have this little extra space in here that is barely visible, but it has one on it. The second one and the third
one all have one in here. And actually this
is the percentage. If I reduce this
from one to 0.5, you'll see that now
the image takes up half of what it used to take, but the green ones
and red ones are the green and random image
are still the bigger, even though the number
right here is still one. And sorry, it's not that
visible for some reason. If I change this
one to 0.5 also. It will become the
same size as the blue one and the green one
takes up the extra space. But what happens if I
change this to 0.5? You'll see that again, they are all the same. So all of these
numbers are relative. It only depends on what the other boxes have
a shape in them. So as you can see
as then as I said, all of these back to one, they regain their sizes. So these are just
things I want you to know and understand
as we move on. So we've understood how the horizontal and the Fill works. The horizontal alignment
and the vertical alignment. Let's talk about the padding. So if we click on the green one and let's add
a fanning of 20. You'll notice that we
have this little crust if you want to call it
around this green image. And if we click
down the banding, you'll see that we
can change this so we can set depending on
the left to be 0. As you can see, it
moves to its side. So that is the power of panning. We can add a bit of light crust or just a little bit of distance between them. This will be very
helpful when we start adding images and texts next to. And I know what, whatever
you can think of, we start adding them
next to each other. So the padding will
be very useful. And that's basically
everything that we have about the
horizontal box. It's simply allows us
to better organize our various images,
are various widgets. Some reason my brain is
working very slowly today. Next we're going to get the vertical box
if we can find it. So if we scroll down, you get the vertical box. So the vertical box is the exact same as the horizontal box except that the vertical box actually thus things in
the vertical direction. So I'm going to
change this to red, changed this 1 second, 1, second 1, blue, the third one to green. Select all three hold down shift and select the upper one. This way we will select
everything in-between fill. And there you go. You can see that we add the same exact images but in a vertical direction, compile. Now next we have the
uniform grid panel. So if we look for
it somewhere in here and the panels uniform, we go uniform grid
panel, we expanded this, just simply get
these three images, duplicate them of that work. It won't. Control C tried
to put them inside. There we go. As you can see, we filled it up
with these images, but we'll select them, will add an extra image in here, select all of them, and we'll see what
we can do in here. First of all, I'm going to
close all of these down. You can see that we
have these four images. So I'm going to take this one, move it to the left
and move it up. This one, move it to the right. This one, move it down and take this one and move
it down and right. As you can see,
these four images have taken place inside of some weird kind of a
uniform distribution. And if we select all three
and set them to fill, and select the last one and make it change its color to yellow. This one for some reason
it's still white. Let's change it to red. There we go. We can see that we have an even distribution
on all sides of it. You can see we have this
Ukrainian flag by mistake, and we have the different
colors that we create. So we can also
move these around. And if we move it even
more to the right, you'll see that we create
a third, fourth, fifth. So this depends on how much you want to move this and
this will create, this is sort of a
combination between the horizontal and the vertical box. So this is basically all
that we need to learn about how the
organization can help us. You can see that
it's very helpful, especially if you have
several objects that you want to set on you have will be using them a lot and you'll
see how useful they can be an hour game
development journey. So the last thing that I wanted to learn about is
the grid panel. So if we add the grid panel, you'll see that it's
no longer a uniform. It's a grid panel. And you can see from the symbol right here, it's the same, but we can add these,
all of these images, but have each image be different in size
than the other one. And this is actually
going to be part of your challenge to
discover the grid panel. At the grid panel
to the viewport, which I already did for you. At the same for images
or six or ten, whatever. Move the images around to set
two rows and two columns. It should be similar to the way the uniform grid panel works. For these images
in order to have proper distribution
on the grid panel. And the fill rules add
two rows and two columns, play around with the index of each and see how they change. And finally checkout the row
span layer and the notch. So this is your time to shine. You are already a seasoned
in game developer. Well, not yet, but still
you have the power right now to go ahead and
learn all by yourself. So pause the video right now
and go do the challenge. Welcome back. So I'm going
to grab these images. I actually know what,
let me just copy this one and put it
inside of the panel. And I'm just going to
duplicate this image 1234. Not four. We just will just
require these four images. And I'll change the
color to green, change this one to loo k and change the
last one to yellow, just like we did before. So select the second image, move it to the right, select the third image
and move it down. Select the last image, move it right and down. And as you can
see, we've created these four little
images right here. So let's select all of them and set them to fill if we can. If we set this upper one, we can set it to row
one and spans 0 rows, columns and all of that. Let me just double-check
the fill the rules. So I'm going to
add these columns. On second one. They are distributed
very thinly. So back in the grid panel, I'm going to set the index
of the first one to one, the second one to one, and do the same on
the parole fills. So now what I'm going to do
is instead of one in here, or let's say I select
the column and the row, and I said this one to be, let us say we set it to two. You'll notice that
the distribution in here is different than
the one that we had up in the uniform
where we can set each one to have its own size
and its own filling. Now you might be
thinking, well what if I wanted to make
this one a bit bigger? Well, we can simply play around with these
values in here and see how we can actually do that
until we find the proper. So you can see we
can increase this. Or we can also select the
image which we want to change. And we can make it column span, so we can make it
span two columns or excuse me, this
is one column. We can set it to
span two columns, but it's behind the yellow ones. So if I move the yellow one
to the right, there we go, you can see that we can set this whole behavior
or span of roles. We can also maybe
select the grid panel, add another filler for the third column and
set this to one. There we go. And you can see that
these can be played around as much as we want.
What else did we say? We need to play
with the rowspan, the layer, the layer. I think it's pretty obvious. If we set this span, can we start to be 1.52?
No, I don't think so. If we set it to be
spanning three, we can set the layer to be one. And now it will be rendered in front of the
image that was here. If we set this to one, it's the same because
this takes precedence. If we move it up in here, you'll see that it
changes the precedence. What else do we have? We want to play with the notch. So if I start playing
with the notch on the x, and we can move it to
a bit, to the right, a bit to the left,
and we can move it upwards and downwards. We can also move
this one downwards. And you can see how the uniform or not uniform panel
grid can be created. So now that we have
all of our panels, we can compile, save, and we can play the
game and have all of these magical
weird-looking panel. So thanks so much for watching. I hope you enjoyed the video. I know it was a bit difficult to understand how the grid works, especially even for
me sometimes is just a process of
rediscovering things. Thank you so much for watching. See you in the next one.
62. Widget Customization: Welcome back, my fellow
game developers. In this video, we
are going to be learning how to
customize our widgets. Basically, we're just going
to learn the properties that are common to all
other widgets and the gain. So then we can delve deeper into individual and important
widgets later on. So let's not waste
any more time, and let's get started. Okay, so now let's
talk about the rest of the properties that we
have in the details. In this video,
we'll be basically talking about the customization. So I'm going to, if you want to keep these, you can create a new
Widget Blueprint. I'm just going to remove
these and start new. I'm going to add a
horizontal box in here, and I'm going to add
a couple of buttons. Just duplicate them. Maybe four. Yeah, sure. Why not? We'll add four and we'll make
sure that they all fill. And it will make
the horizontal box a bit bigger and maybe add a bit of padding on all
of these boxes of like, I don't know, like ten,
maybe ten is good just so we have a bit of difference between them so we can see
everything properly. So first of all, if we select one of these
and scroll down, you'll see that we
have the appearance. We've already
talked about these. We'll delve deeper into the
appearance of the buttons. Now we want to talk
about things that are available on everything. So we'll start off
by the behavior. First of all, we
have the tooltip. This adds a description when we hover over our
widget and the game, we can also bind it, as you can see right here, binding means you'll be
able to change whatever is inside of this variable or
this property by using code. So when you bind
it, for example, create binding the record. You can see that you
can change things in here so you can play
around with the code, maybe a faith or opens,
this will change. So there you go, That's biding. I'm going to delete this and we're in the
graph by the way. So to go back, we need
to go to the designer. Next we have the enabled. So basically this
simply makes the widget is either enabled or disabled. If we turn it off
and play the game, there's something
complication arrow, resolve shortly in
the editor, whatever. So you can see that it's
disabled, it's favored, It's not like
completely disappears, it just is unable
to work properly. Let's remove the binding here. I think that was the error. Next, we have the visibility. You can see we have
five options in here. For example, if it's collapsed, you play the game, you'll see that it is
no longer available there and something
takes its place. If it is hidden, then when we play the game, you'll notice that there is. Wait for a second. I'm going to anchor this to all sides so we can properly
see what's happening. So now when we play
the game, There we go, you can see that
one of these has disappeared because,
because what? Because if we scroll
down it is hidden. So hidden means
that it will take, nothing will take its place. Actually know what, let's
anchor this to the middle. I think it's better. Anchor this to the middle. Set the alignment to be 0.5 by 0.5 and reset the
positions compile save. And now when we play the game, there we go, we can see
that we only have three. The fourth one is hidden
while in the collapsed, it was taken at somebody
has taken its place. We have the non-header, the non hit the ball
and the hit testable. This means that we can either
click on it or we can't. I'm going to keep it as visible and now compile play the game. There we go. We have four. Next we have the render
opacity, pretty clear. We can either fade it
out or keep it at once, or if we set it to 0.5, it will be a bit faded
when we play the game. There you go. You can see it right here. Next we have the
render transform, and I'm going to
issue a challenge to play around with these options. So understand the render. Play around with the options. I seriously, I didn't remember that I've written the
exam exact thing. Same thing. He was the extremes to see
how they are being adjusted. Make sure you also understand how the pivot
changes everything. And if you're feeling brave, explore everything
else below that. It's very simple,
it's very easy. This video is just
for me to help you, just to not leave you alone with everything you can explore
on your own, I'm sure. So pause the video right now
and go do the challenge. All case. So if we select this one and
we select the translation, you can see that we
can move this around. How cool is that? Next we have the scale. If we select this one, you can see that we can scale in the x-direction and
the y-direction. Next we have the shear. So if I play around
with the shear, I don't even know what that was, but as you can see,
obviously, we can. Play around with
this and make it, I don't know, I don't
even know what that is. And finally, we have
the angle which allows us to play
around with the angle. Now let's see what
the pivot does. Obviously right now we are
pivoting around the middle because the alignment of
the pivot is the zeros 0. If I add 0.5 by 0.5, if I then set it to 00, then when I add the angle, as you can see, it rotates
around that point. So 00 is the top left. If I add the 11, There you go. You can see that
now when we rotate it around the point
that is down there. So that's everything
you need to understand about the render transform. Let's scroll down. We have the performance is
volatile if true, prevents the widget Charles geometry information
being cached. Basically, all this does
is if it's volatile, that means it might be
changed or something we can cache information
about this button. If not, if it's never
going to change, that means it's not volatile. That means we do not
need to check this. And this will increase the performance or
at least decrease the amount of resources needed. This is pretty advanced, but just so you
know what's going on next, we have the clippings. So if I said the clip to bounds, if we said the clip to bounds, you can see that this will make everything
outside of it clip. So this works on the parents. So if I select, select clip
to bounds, there we go. Everything outside
gets clipped out. When we compile
and play the game. There you go. These are our buttons. What else do we have? So finally we have
the navigation. I'm going to make this a bit smaller and just move
it out or do actually, let's just yeah, sure. Let's delete it. Let's add
a another horizontal box, horizontal locks
and make it bigger. Let's add button. We'll add spot in here, duplicate it four or five times. Actually know what? Why is it a horizontal box? I don't want it I want
to have a grid box. Grid panel, uniform grid panel. Yeah, this should
work a lot better. Get the button. Will put buttons in here. Boom, boom, boom,
boom, boom, boom. Have six buttons. Move this one to the right, this 12 times to the right. Move this one down, this one down, and write
this one down and right. And let's select all of these
and make them fill warm. And we'll add padding
on all of these. We select the uniform
panel, whereas the padding. Why did I forget
where the padding is done on the
individual buttons. We have the six buttons. Whether this one go, Wasn't there a button here? I'll move this one
down right here. For some reason I had
lost the padding, so I'm going to add ten in here. So we have a bit of padding
between the buttons. So Compile Save. Now, if I scroll down
on one of the buttons, you can see that we
have the navigation and obviously the events that you can add on
clicked on breast will see those later on
or in the next video, I believe the navigation
you can see, for example, on this button, if we click
on the left, we escape. On the right we escape, but we can do
something different. For example, we
can, on this one, if we click on the right, we can escape or we can wrap. If I click on this ramp, Let's test this out. We play the game, we
select the button. And you'll notice to the left, you can see the cursor. There we go. If we click left
again and disappears, if we look right and
click right again. So These are the way we
navigate with our buttons, but it's not very clear. How can I make it
a bit more clear? So basically this is how we go from one button to the next. So for some reason
this is not very good. Let's try to I can
look up and down. Let's try. So there you go. You can see that I can move left and right
between those two. But when I click the left
again, I cannot solve. That's basically it with all of that information
out of the way. In the next video, we'll
be delving deeper into textboxes and buttons.
See you then.
63. Text Box and Buttons: Welcome back, my fellow
game developers. In this video, we are
going to be delving deeper into textboxes
and buttons. So let's see what we created
when we play the game. You will see that we have this text right
here with a bit of shadow and are all uppercase. And you can see this button
that is currently orange, but when I hover over it, two things will happen. First of all, it will
change color and then we will print out Hello at
the top left screen. When we press it, it also changes scholar, we get Hello World,
we release it, we get My name is
N1, we uncover. It is my name, Michael Moore. So let's not waste any more
time and let's get started. Okay, so now let's take a closer look at text
boxes and buttons. I'm going to go back into
my widget testing in here, and let's go ahead and
learn more about the texts. So if I open up the
commons right here and search for the
tax dragged in here, there are a couple of things
that we need to talk about besides the obvious
slot panel right here. First of all, we
have the content which we can add a text too. So I can say right here, hey, there, it's Michael. There we go. So you
can see that the text has changed and we
can also bind this to a certain function
that we then can change during gameplay
depending on what we need. Next, we have under
it the appearance. Obviously we have the color
and opacity so we can change the color of our
text. That's obvious. Then we have the font. If I close this down or
let's just scroll down, we have the font, obviously we only have the robot for now. But what you can do is go
to this nifty website, which is called the font.com. And this will allow you to download any font
that you would like. And one that we are going to
be using is the cyber spy. Let's see if we cyber,
Let's try cyber. One of these and think, I'm going to use one of these in order to add a
certain character, a certain feature to our game to make it much more exciting
later on in the course. You can also add whether
it can be bold, italic. Let me zoom in a bit. We can increase the size
instead of zooming in. So we can change this to italic, we can change this
to regular weekend, change this to bold. You can play around
how much you want. You can increase the spacing
between the letters. So it really depends on how
you want your game to look. You can also change
the material, but keep in mind this is a special material specifically
made for one of these. So for example, you can
just add the brick. It will not work. So you'll need to
add some kind of special material for your fonts. Next we have the
outline settings. So if I increase the outline
in here, there you go, you can see that we
can add some kind of outline and
customize it to our, to a certain extent,
for example, changing the color to red. So I don't know how that
would work, but let's see. There we go. You can change that
to whatever you want. Let me close this down. Next we have this strike brush. This is a more of a
graphical design thing. It can add to your text using
certain images or certain, certain image sizes, certain tents and
so on and so forth. We have the shadow, which is very important also, we can add a shadow. For example, if we, let's see if we
can add a shadow, the shadow should have a color. Let's make the color red. Let's see how that will look. Still nothing. Let's try maybe we are. So we need to set the
alpha 21. There we go. So you can see
that we have added a shadow and we can
move it around. A shadow is very nice
in order to have this some kind of a 3D look. Obviously this is a bit too
much if we just, There we go. So we can see that
now we have a shadow. Now you might be thinking
that text is a bit small. The textbox right here, a small, what you can do, you can either
make it like this bigger. We can scroll up right here
and make it size to content. So now whenever you
change the size, you can see that the
box changes with. If we click in here
and scroll down, we still have a
couple of options, which is the minimum
desired width. So if you, for example, at this textbox into, let's say, I don't know, maybe
a horizontal box or a vertical box and then the vertical box or horizontal
box squeezes the stacks. You can set the
minimum desired width to save the integrity
of the stacks. So keep this text the
same size as it is. So there will be a minimum size. It will not be under
it no matter what you do inside of
the horizontal box, this can be very helpful. Next, we have the
transform policy. Obviously you can set
everything to be lower. You can set everything
to be upper. Down here next you have
the justification. So if you've ever used PowerPoint on or any
of these things, you can set the justification
of the text obviously in here it will not work
because its size to content. If we uncheck the
size to content. And let's make this a bit
bigger than the text. Actually, let's make
the font a bit smaller. So you can see that I can set the justification to
be in the middle, to be on the right or
to be on the amine, on the right, or on the
left or in the middle. There we go. So that's basically it. We still have, That's it. Those are the basic things. We have the wrapping, this is also very important. So for example, we can
wrap the text after a certain amount of
words have been added. You can see as we increase it, some words should start
going next to each other. And there we go. So we can see how the text wraps or you can set
it to auto wraps. So now when we close this down, you can see that the
words will start to wrap. If it's big enough,
they should fit. If we don't have the text. There we go. Auto Rab
can wrap text around. It's also a very cool feature that you can play around with, see how you want your texts
to behave. Basically. Was that out of the way? Let me just make
this a bit smaller. Put it up here.
Now let us drag in the bottom and talk about the options that we
have on the bottom. So if we scroll
down or scroll up, Let's see where
all of these are. In the appearance. Obviously we have the color and opacity. Opacity. We changed the color of
the button that you have. We have the style which
we'll cover in just a bit. But first of all, let's talk
about the background color. So if I have a text right here, we can see that we can add it
immediately to the bottom. This works similarly to the
way the root component works in that if we change the
background color to red, are actually this will change the color of the button or
the background of the button. Let me reset this. This is not what I meant. I meant to change. If we change this to
red, there we go. So I was a bit confused there. So as you can see, we can change the color and opacity
and this actually changes the color
of any text that is insights are similar to the
way the root component has. Its color and opacity
will change as all the elements that
are his children. The same works for a button where you
can change the color. And similarly, the white color will simply be nonexistent, so it will not be taken
into consideration. And if you change the
color of the text box, the text right here, and change the color and
opacity of the bottom. The colors will be blending. Now to the exciting part, which is the style. So as you can see, we have the normal hovered and pressed. And we have in here the normal foreground hover tour ground pressed foreground, and the disabled right here. So all of these are the options for the
button as you know, whenever you, let's change this a bit so you can
see the difference. If I click, obviously
we have the image, image size they tend, and all of that good stuff. So if I change to the
normal color to be red, then the hovered
color to be blue. There we go. The Press color to be yellow. Now if I compile, save, and play the game, you'll see that when
I hover over it, it becomes a blue. When I'm not hovering over it, it's red and when I click it, you'll see that it
becomes yellow. So when pressed because there
is a difference between clicked and press it and
you'll see that later on. These are basically
how these work. And we can also add a
image to the background of this button and change that
image as we move over them. We can also change
the foreground color. So if I, for example, select the foreground color
to be blue when it's normal. There we go. Then when, and also we make sure that it has
an opacity of one. See how that will look. Then change the hovered color to red and chain depressed
foreground to green. There we go. So this two Alpha to be one. Here also will set, oh my God, what's happening? To be one. Also, we have the padding. The padding on the normal is 21 plus we can set this to maybe, and let's set it to 70 just to see the
difference properly. And we can also add a pressed
sound and I hovered sound. So when we compile
and play the game, let's see how that might look. So when we hover over
it, when clicked, nothing is changing for
depressed foreground color. Okay, So I've been
trying for some time, but for some reason
it's not changing. I don't know. The padding is working a bit because I've added a padding on the press, but for some reason the foreground color
isn't really working. I don't know why. I'm really stumped. Sorry.
I'm really, really stumped. I think you can see that
one of them did work if I try to recover this, but for normal, it
should be blue, but in here it's red. So I don't know if it's like merging with something in here. I don't know. To be honest with you,
it's very confusing. But anyways, this is how
it should be working. It always worked. Maybe there's some
kind of bug right now. But anyways, these
are the basic things. Now before we go, I need to tell you about
these down here on the clicked on pressed or released and on hovered
and on Hubbard. So if we add an event
to each one of these, we can see how
they might change. They can do things
if we click on the bottom or if we
press on the button, press and then on release or
press means that we press and hold down on release
when we remove an unclicked, when we just simply click. So the act of pressing
and releasing that is the click
back down here. We also have the on hovered
and on the UN-HABITAT. So keep these in mind
because I'm going to issue you a challenge to create the weird at the button. Create a button and take, and add a text as a child to it. Set an image for that button. Make the image when we hover over it and when
pressed different. So you'll need three images. Also make sure the text
changes scholars and each. Now, if you don't
do this challenge, I will not be very angry with
you because I don't know, for me, it's not working maybe for you it
won't work either. I hope it does, but
what can I say, guys? I'm doing everything right. Maybe there's some kind of Bob, maybe we need to restart it. And finally, the most
important part is to print out to the
screen hello world. My name is, you add your name using the
five events below. Each event must print
a certain part. You understood what
the events are. These are the green
little buttons down there with all of
that information. Pause the video right now
and go do the challenge. Okay, welcome back. How did you get all of that? I really hope you were able to make these work the
foreground colors when pressed, I don't know, I'll just
reset this anyways. Let's go ahead and
do the last part of the challenge because I'm not
going to be adding images. It's pretty obvious,
pretty easy. You simply add them
right here on the style. I'm going to scroll down and I'm going to create an onclick. This is going to be
a bit tedious on pressed back into Designer, On released back
into the designer, on hovered, back into
Designer and on Hubbard. Ok, so now we have these five functions
and we are going to or five events that we are going to add a print to
each one of these. So the first one on clicked. So how are we going
to work this? We should say, Hello, Hello world my name
is and your name. So I'm going to start off, first of all, it's obviously
going to be the hovered. On the hovered we're
going to print. Hello. Obvious. Let's add ten seconds. Do it. Ten seconds. There we go. And let's just keep, Let's make the text read on
Howard than on the pressed. We are going to Hello, World. We go on depressed
than are actually on the released and then the clicked should
be given to us. So once we click in here to
Hello World, what was it? Sorry, My name is
my name. My name. Let's just add it like this. And then finally when clicked
because we release and then we get the
click, my name is. And finally the last one when we uncover from the bottom,
it's going to be, well, my name is Michael Morell, founder of double m
game development. So compile, save, and let's
play and test this out. First of all, we're
going to hover. Hello world. My name is Michael Moore, so thanks so much
guys for watching. I hope you did your best. I hope you try to
create the events here. If you haven't, please go back and try to look
at them so you can properly understand how
each one of these work. So see you in the next one.
64. Binding In Unreal: Welcome back, my fellow
game developers. In this video, we
are going to be learning about the
progress bars. As you can see, I have my
progress bar right here. I've angered, anchored to the middle because for some reason by the
end of the video, I tried to anchor
it in the middle, but it's stayed up here. That's why I didn't
quite look as good. So forgive me for that. That will be like eight minutes in the
future, maybe nine. So now when we play the game, you'll see that we
have this health bar. This represents
our actual health. And if we go to the corner where we have a pain causing damage, you'll see that every
single second we are losing 0.1 of our health. We are losing 10% until finally we die when we don't
have anymore health. And that is now reflected
on a Health Bar. It's no longer just some kind of words appear on the
top left corner. We have actually
created a Hepburn. So let's not waste
any more time. Let's get started. Okay, so let's talk
about the progress bar. This is very important and will be used a lot
in your games. This can be anything
from health to magic, to opening doors to
getting into cars and whatever else
you might think of. So let's go ahead and add
one of these progress bars. So if we look in the
comments, There we go. This is a progress
bar. Once added. It's just a black image, maybe you might
think of it, but no, this is actually a progress bar. And you can see it right
here on the progress. If we just add the
bill of percentage, you will see that we
are filling up the bar. So let's talk about a
couple of things in here. First of all, we have
the style that only has one property
which is the style. And under this style we have the background image fill
image and the marquee. Obviously the background
image is whatever is in the background when the
percentage is down. So for example, I can
add an image in here, change the image size, and change the tint. For example, I can
set the background to be read or to be green, but usually, usually it's
either white or dark. Or you can change this
from an image to a box, which is basically nothing, or to none which
makes it transparent. So this really depends on how, if you want your game to be
played as I'm going to set this back from
nothing to an image. Next we have the Fill image. Obviously this is what is
filling the image right here. But notice that it's white, but in fact it's not white, it's green and it depends. Actually, sorry for that. Let me just restart this. You'll notice that it's blue, but that is because
of the marquee image. And we'll get to the Marquee
image and just a bit. You'll notice also that we have these lines going around
and we can change this to, for example, represent
the green or for it to be blue depends if it's
magic or if it's health. So I'm going to set this to 0 on the glue one and
now it's fully green. Now you might be thinking, what are these lines
and why are they? Are they moving to the right? If you look down in here, you can see that we have
the enabled fill animation. We can turn this off to stop
these lines from moving. Now what if you want
to remove these lines where you can see right
here and the fill image, the tiling again, click on this. You can set them to be vertical. You can set them to be both. So if I try to zoom in, you'll see how they look
or we can set them to know tiles so we don't
have any tiling. There's still a thin
file right here, but it won't be noticed
from a distance. And finally, we have
the marquee in here. But before we talk
about the Marquee, I think it's better
to the Marquee is exactly the same as up here, but let me tell you
what the Marquis is a when we talk about
the progress down here. First of all, we
have the percent, this is how much
the bar is filled. Later on we will be binding
this to a specific value, which is going to be the health of our third-person character. Actually, you'll be doing that. Next we have the option
for the bar field type. We can set it left and right, right to left fell
from the center. So if we increase
it, there we go, you can see it can get really creative with this
top to bottom. There you go. And bottom to top. There we go. So usually it's better
capital left to right. Next we have the more key
the market if turned on, you'll see that it will use the Marquee image and this
percent will no longer work. What is the more key? This indicates that something is being processed
in the background. If you've ever seen how the
windows, like when you, whenever you have some
kind of error or you're trying to close down
a certain window, but it's not closing. You'll notice that you have
this bar trying to fill, but it's not actually filling. It's just a bond that's going from the beginning
until the end. It gives us going around and indicates that
something is happening. Maybe I'll, I should
have added an image, but I'm sure you've
seen it before. It's not a bar that fills from
the beginning to the end. It's actually a chunk right
here, like a chunk of this, and it's all moving to
the right and then again, and then again, or
maybe we can have several ones going from
one side to the next. This indicates that something in the background is happening, but it has an indefinite
time until it ends. That's basically the more key. Finally, we have
the border padding, which shouldn't be too
hard to understand. You can add a border from the
left and a border on the y. And for the bar right now we'll
fill on this little side. This way you can add a border, a certain border to
your progress bar. So that's basically all
of that information. Now, the progress bar is really useless unless we bind it
to something in our game. We are going to do that. And actually you are the
one that's going to do that by doing the challenge of
binding the bar to health. So first of all, create a Pain Causing volume. You already should
know how to do that. One of the player into
it makes sure that that makes sure we only deal zero-point one
damaged per second. You should find that option on the killed volume on the, sorry, on the bank causing volume
change the player to health to 10 at max if
it's not already. Now in the graph where
Widget Blueprint get a reference to our character
and stored in a variable. This is very important from the event construct,
you can do this. Finally, go to the
progress bar and buying the percent of the character
than to the health variable. So go to the percentage on the progress bar and try to
figure your way through that. Pause the video right now
and go do the challenge. Okay, So how did you
get on with that? First thing first is we're
going to compile this. We're going to go
back to the person, character, ThirdPersonCharacter,
check the health. We'll set this to one. And everything seems good. Compile save. Now back in the widget
testing in here we're going to go to the Create,
got the volumes. And let's check for the
Pain Causing volume. Let's add it right here to the upper left corner on the side because
it's an invisible. We'll add it right here. And we're going to
select it in the details and make the damage
per 2.1st 0 because, because otherwise it will kill the player instantaneously. So that's all good. Control S. Now back in the widget
testing will go to the graph. And down here we're going to
find the event construct. And from here we're going
to get layer character. From the player character. We're going to gas too. Third-person character. Set it right here. And then we are going to promote this to a variable
which is going to be third-person character. I don't know why they added
as every single time, maybe because of you cast it
as a third-person character. So I don't know, Compile, Save. Now when we go back
into the designer, scroll down to find the percent. We can click on this and we can bind it to the
third-person character. And if we look closer, we can see that we can bind
it to the half compile save. And now what we should
see when we play the game is that we have this
health part that is full. Maybe this is not
the best place. Let's just shrink
this one though. So it's nothing the
way put it right here, compile, save, and
play from here. Still the borrower is very big. That's because we haven't
anchored properly. So if we add an anchor
to the middle now we compile and save, play the game. Still not that
good, but anyways, you can see that we
have this 0 right here. The bar is completely full. If we step inside, we should see that
every single second, one Mississippi,
two Mississippi, we are slowly losing our health. And hopefully when it
gets to 0, there we go. We disappear because that's
what we did right here. We said that we need to destroy the player whenever we
don't have any more help. So thank you so
much for watching. I hope you enjoyed this video. I hope you are always doing your best to finish these challenges. We still have one very important
video in this section, which isn't the animation, which is going to be a bit long, a bit mind-boggling, a bit
hard, but certainly worth. See you then.
65. Animations: Welcome back, my fellow
game developers. In this video, we are going to learn how to use animations on widgets and really put the
motion and motion graphics. I'm going to play this
game and I'm going to walk towards a trigger
volume that we have in here. And you'll see that we
get these two buttons and the two images that
appeared down below. Now, I'm going to warn you, this is a very, very long video and a
very, very hard one. I just want you to put your fault concentration
capsule and understand that animations
are hard to teach, how to learn, hard
to understand. But they also require a lot of trial and error and
trying and trying again, in order to fully comprehend everything
that's around them. I tried to go as deep
as I possibly can, sometimes make mistakes around here the challenge is very hard. But this video is like the
next step in your evolution. If you can't complete
the challenge, you'll be left behind hundreds
getting dry your best. Have fun. Enjoy this video and let's
not waste any more time. This video is already almost half an hour and
let us get started. Okay, so dying to learn
about animations. First of all, located along the bottom of the Widget
Blueprint editor, there are two windows
which allow you to implement and control
animations for your widgets. The first one is the
animations window on the left, which allows you to
essentially create the animations which will
have tracks on them. And the second one
is the timeline. This is where you
will be actually manipulating your widgets,
setting the keyframes, setting the timelines,
and determining how these animations
will be animated. So without any further or new, let's start adding animations. Pretty simple. All you have to do
is simply click on the Plus animations. And now you will be prompted to call this animation something. I'm going to call it
animation testing right here. Now, when we click on this, you'll see that our
timeline is no longer or isn't right now unable and
is no longer transparent. So what we are going
to do in here is we are going to get some image. So I'll grab an image, drag it into the world, and make it a bit bigger, anchor it to the middle. And you'll see right
now when we click on the Plus ad track that we have the option to select
the image one, the image one canvas panel slot. Now these are
basically the same. This is just like
a small shortcut because when we click on this, you'll see that
we have the image and we have the Canvas slot, which we can add a track to like for example,
the alignment. Or we can add another track
which is the ZAB order. And we can change all of
these during gameplay. And you'll see that there are little gray like slabs
in here created. This tells us that we are able to play around with things. If I move this to the right, you'll see that I have the
option to change this. And as soon as I change it, I have a change in displacement. Or a small little red dot in here that tells me that we
are changing something. There has been a change. And now if I play, There you go. You can see that this changes the position of our
image right here. We can also change
these at order. Obviously, we can change
everything that we want. I'm going to remove the
alignment and these add order by simply deleting them and then go to the
canvas panel slot. But there is something that
shoe might have noticed that the value in here has
actually remained the same. And this is something
you need to really take good care of. Because if you delete
things like that without actually paying
attention to what's happening, you might have a lot of trouble. Animations are a very, very tricky thing too. Fully comprehend and really understand how to
move around on. Even me sometimes really get frustrated because
I do something, I changed it, and I then come back and it
doesn't work properly. Let's now focus on
moving this image. I'm going to put it right here. I'm going to add a track. I'm going to go
into the transform. And you'll notice
that right now, I don't have a Canvas. Let me just show
you just so you can properly understand
when I delete this, if I still have the image
selected and I'll select image, you'll see it's the
exact same thing like the Image
Canvas slot panel, but without the
Canvas slot panel. And if I want, I can
simply add the trend here. That's move on. So when I click on the image, I click on track.
Click on track. You'll see that I can
access the transform, and this is the transform
that is right here. And you'll see that I have
the same exact options, which are the translation, the rotation, the
scale, and the shear. So if I move this down the
timeline and add the 2.5th, I'll move the x
to this position. Then add another 2.5th and move the y down
to this position. Then at the 1.5, I move the x back here. And then the two, I will move it or I will move
the y up to this position. If you want to go back
to the exact same one, you can simply select
these two copy and then maybe at this point,
just Bayes them. Let's see if that will work. Nope, doesn't look like it will. Well, you can simply
copy the values in here. But for some reason I
remembered, oh, there we go. I knew that would
work. So there we go. And if you wanted
the last frame to be exactly where it started,
simply drag these. Simply select and drag these if I can select
them to this position, you'll notice we still have
a bit of red line in here which indicates that the
animation hasn't finished yet. We can select this and hopefully we can move it
somehow if it allows us. Okay, there we go. So you
need to select it right here. Now when we play, There we go. You can see that we
make a full circle and come back to where
we were initially. Now if I put this right here, and then we have these
values from when I was trying to copy
and paste them. And it didn't work. It did, but it took
a lot of time. You'll see now we come back
to the exact same position. Not quite because this
should have been 00. The translation in
here is different. But there is
something you need to understand when we
set this right here, because we're changing
the translation when we click in here
and select this, you can see that this is no longer where we had the image. It is the image we've selected with the translation
that we have. When we set this right here,
replay this animation. You'll see that now it's playing
right here to the right, which is not a very
good thing to do. We need to put this
back in here and now play it again
to make sure that it plays in the exact same
place that we needed to. These are just things that
you need to keep in mind of. Obviously, once you
start doing animation, it's going to be
very frustrating. You're going to make
a lot of mistakes. But as you move through these, you'll start to
understand better and better What the
heck is going on. Now, this was the manual way
of setting the transform or the c. For some reason
we removed our image. This was the manual way of moving the image around and setting these keys right here. There is also an automatic
way of doing this. If we click right here
on the key channel. Now whenever we move the image, we are going to set a new
key on a certain position. So when I move this,
nothing happens. Why is that? Well, because the translation or the transform that we have in here that affects the translation is in
the render transform. In order to move this, and we need to make
sure that we move on to the adjust widget
render transform some. Now, I will move it to this position and nothing would happen because again,
I forgot something. We need to make sure whenever
we are changing something that we have the proper
track right here. So now when I said the transform,
hopefully, you'll see, let me just set this right
here now when I move to this position and
I move the cube, bam, I should see when I play the movement that I have
right here, Let's skip it. Skip it right here. Move this to the one, this down. Move this again, this
slavery, this list again. And like this. And now when we
play the animation, you'll see that we have proper movement of
everything. How cool is that? And you'll notice
we get two of these because we have
selected the top one, which is right here
whenever we were moving. So if you want to have
absolute movement, so first the x, then the y without the, without changing
in between them. What I mean by that is, you'll see if I
remove, for example, in here the Y, you'll see that this not
only moves in the x, also the y is changing
because on this one, the y has changed also. These are also things that
you need to keep in mind. There are a lot of
things if I need to go into every single detail, boom, this video would
probably be 20 minutes. Switches probably will be. For now, let's just
focus on the main thing. Let's create a small animation. Remove this image has been
destroyed for some reason. So Control Z that
regard the images back. As you can see, not very fun and needs a lot
of time to adapt to. Things happen, things
very weird things happen. What else should I be
telling you about? I think that's about it. Oh, one more thing
that we need to talk about how to play
this animation, because even if we have
the animation right here, let me just reset the
position of everything. This position. There we go. That
we add a track. No, nothing is being
added for some reason. Even though we have
everything set up properly. Let me remove this
transform and see if I can just start fresh again. So make sure we're
on the zeros 0, add a track for the transform, select the translation,
move this right here, and move this up a bit. So now there we go. The one-minute mark,
we move it right here. Notice if we select only the x, for example, and
move it like this. Sorry, let me try this again. We select the x only
and move it down. You'll see that the Y also has a middle way trigger on it. And then thus the y is
also created right here. We have this small
animation when we play. If we compile and save
and play on game, you'll see that the cube isn't actually moving onto the image isn't actually moving. So what do we need
to do is we need to actually trigger
that animation. If I unclick on here, select the image and move
it to this position. Click on the animations, and now I play it. Everything seems to be good. If I play, it is at the
end of the animation. This is not what we really want. Free select back in here. Move this position,
select animate. Let's try to do them all
of this back properly. Check it. When we play. We should see that it's
in its proper position. So it compile save. If we go to the graph after
we select the third person, I'm going to drag in the animation which becomes
one of the variables in here. So drag it, hold down control, then drag from here and
select Play Animation. So as soon as we start the game, we should see the
animation blade. So Compile, Save, play the game. There we go. You can see how the animation was played from the beginning. With all of that information, I'm going to issue you
a bit of a challenge. Your challenge is going to be
one of the really hard one, because you'll need
to first of all create two buttons that fly in from a preferred
direction of your choice. Next, make two images
that will appeal. And now make all of these change colors for
a couple of seconds. If you want to keep
things simple, simply change the
colors of a the images. Finally add a trigger
box and the world to activate the animations
when you walk through it, pause the video right now, and go do the challenge. Oh, okay. So I'm going to
remove these from here. I'm going to go back
and the designer, and I'm going to delete
the animation in here. I'm going to get this image. So two images that appear, I'm going to duplicate this
image and set it right here, so these two images
will be invisible. Then I'm going to add
a button right here. If I move it outside, I'm going to move these two buttons and
have them be outside. And this is best practices
because you need to set the widget that you want to animate already
in the beginning. So where will it start? That's where you want to set your widget before
you start animating. This is for best practices. It's not a perfect
solution obviously, but it's the best that we have. It's also good practice book
will have that with you. So I'm going to make sure
that the translation is 0 on both these images, so we don't have any
weird things happening. So I'm going to create
an animation in here, call it the button fly. And another one called
the image appear. Color on the button fly in. And I'm going to
select this one, add a track for the bottom. Add a transform in here. I'm going to move
this to position one. Simply drag this
over the screen. There we go. Maybe set it right here. Then the bit of movement, set it like this. And finally add a bit of
movement it to finally Saturday, subtle in this position. So now we'll see we have
this kind of jerky movement. I'm also going to create or
select the second button, which is this one, add a
track under the name button. Then this position, I'm
going to move around. So I'm moving the button one. I want to make sure I'm
moving in the bottom to add a track or for the initial button which
is called lot and 0, but I call it the button to
select transform translation. First, second mark
which is here. Or actually, which
is right here. So we'll make sure
that these are all, they barely touch
at this position. Then right here. It moves back. Maybe it's a bit
more, more jerky. And finally, right
here. There we go. So now when we compile, now when we play the animation, bam, we have all of
them set properly. Now for the image appear, I'm going to select
these two images, and I'm going to set
render opacity to 0. I think this is the
one that we'll need to Claire and width add a track for the image one and attract
for the regular image. Both of these are going to have a change in the render opacity. Add the second one. The opacity of the
image will become one. Now when we play There we go, the image appears for
the second one will also have a render opacity, but this one will appear
a bit sooner, maybe. Maybe on the halfway there, it will be fully apparent. So now when we play
from the start, something didn't quite work because didn't we set this
one to have an opacity of 0. Maybe we should set this one
to have an opacity of 0. So now when we play, this appears very fast. Okay, So obviously we
made them stick in here. So what I'm going
to do is select this one and simply
delete the whole track. Set this back to 0. Set this back to 0, select the track,
render opacity. Move this one to have the
time and set this tool. Now we should see that two
previous to the beginning, which I'm going to set this manually lay there
regards to one appear, appears before the other. And now I'm going
to go back to 0. Actually not the 0 at this point when both are fully visible, I'm going to add a
track of the image, select color and opacity. So we could have changed
the opacity right here, but I decided to
just choose how much possible or use them as many
options as we possibly can. So at the 1.5, I'm going
to set along these two, be 0 except the red. So the image should become, we were setting also the a, so keep it at one opacity. This changes from white to red. Then add the second two. This will change from
maybe from red to green. There we go, or too yellow. So we slowly move, then green. So let's see how that looks from this position play seems
to be good enough for me. Then on this button,
on this image, on the second one, we're
going to, you know what? I think that's enough because we already know what's
going to happen. So compiles save. If we unclick in here. If we go back and play, there is nothing,
okay, Excellent. So back in our game now
the next thing we need to do is we need to
go into our world. We need to add or
create a volume, are just going to be
the trigger volume. Going to add it right here. We're going to open
up the blueprint. The begin play. What shall we be doing? We should go into
the third character. So third-person
character, because that's where we are creating. If we go back to our third
person character now this might have been one of
the tricky spot for you because you might have
not known what to do. But what we should do
is we should create, promote a variable in here. This variable is going
to be our remove this. So this here, this variable is going to be our
Widget Blueprint. Also we already have, well, this is one that
is not what we need. We need a widget, BP variable, it's on, this is the widget DB
variable compile, save. And now when we go into
the widget testing, or actually the widget
testing which is here, which is our level. On the beginning play, we should get a reference
to the player or no, actually not in the
beginning play. We don't need that on the trigger volume
while holding this will right-click add an event and then collision on
actor began overlap. We get the actor will
cast to third person. We are going to get
Widget. Get which BP. From the widget BP
we are going to get. Let's see what was it called, The appear or something. Let's go into the
widget testing. See what, okay, So button
fly, button, get butterfly. And also the image, something, image appear, color. There we go. So from here, we're
going to play, or actually we're going
to create a sequence. Sequence. We're going to play animation. Play animation. This up right here, this right here. Attach these. So what happens right now is as soon as we trigger volume, we check, is it the
third-person character? We get the Widget Blueprint
variable from it. We get the animations. We said that in a
sequencer and we block, play both animation, so Compile. And the problem is we need to
set the targets obviously. So we'll set the target right here and set the
target right here. Now this is something
you might not have done. Because in here when we
were playing the animation, the target was set as self, but in this case the target, the widget that
we're playing it. So Compile, Save. And now when we play the game, when we walk towards the
trigger, there you go. You can see that the
two buttons flop flight in and the images appeared
and change colors. So what an overwhelming
thing to understand, what a long video to
teach you this in. I know this is a huge, This is very hard
for me personally. As you, as you saw probably
I made a lot of mistakes. I forgotten a lot
of things because animations are really
that hard to master. There are many things
that we can delve into. Many things that we need to
still understand about them. But when, once you learn them, your widgets become much more interactable
and much better. Thank you so much for watching. I hope you enjoyed. I hope it wasn't
as hard as I felt. It was to teach you. And I'll see you
in the next one.
66. Section 14 - CyberSpy 3027 - Adding The HUD - Displaying Health And Gems: Welcome back, my fellow
game developers. In this video, we
have gotten rid of our ugly printing that
we had previously. And now when we play the game, you'll see that the gems
that we need to collect or 0 out of one and the health
is displayed properly. So when we stepped
on spikes out, health is displayed below. And when we pick up a jump, you can see that it is no longer only printed on the top left. It is actually displayed on
a widget in front of us. So let's not waste any more
time and let's get started. Okay, so welcome back
to a new section. Let's get started.
In this video, we're going to be displaying
the health and the gems. And I've probably said
that in the intro. So let's get started. I'm going to
right-click in here, create a new folder called
a DUI. Open up the UI. I, right-click in here, go to the user interface and
create a Widget Blueprint. I'll call this underscore. Discard the UI or
general your menu. I, let's call it main UI, or nonetheless, call
it the character. There we go. More appropriate. Open this up. Now in here we are going to be creating
everything that we need. Now, keep in mind everything
that I do in this video, you can fully customize it. You don't need to
follow what I do. You can do whatever
the heck you want. This is all based on
your preferences. So first of all, I'm going to add
a horizontal box. Just try to keep up with me. I'm going to add
a horizontal box. Next, I'm going to add a
text, this horizontal box. Then I'm going to
duplicate this text once, twice, and three times. So now we have four texts. The first text we're
going to scroll down in here and see where
we can change this. We'll call this the
gems collected. There we go. Without a space next to
the second one is going to be the gong to call this 0. And the one after that
we're going to call, we're going to write
in it the slash. And the third one, we're
going to make it 100. Now, what does this look like? This looks like the 0
is going to be variable and bound to the number of
gems that we've collected. The 100 is going to be
the chance that are required and the slash is going
to separate between them. Let's call them appropriately. The second one is going
to be the gems collected. We are going to make
sure that it is variable right here,
selected valuable. And then last one is going to
be the gems required text. And it also is going to be variable for some reason
this is very foreign to you. Anyways. Finally, we are going to, finally we're going
to select all of these will make sure
that they fill. Doesn't seem very good. So I'm going to take them back. And I'm going to instead make sure that all of these
have a certain size. Because if I compile, save and also makes sure that the horizontal box is
attached to the top. Let's set this in here. Compile save. I want to, I want to go in here and I
want to test this out. I'm going to go to the content. I'm going to go into
the where's the player? Gems enemy exit
door, FPS character. There we go. And my character, as soon as we begin play, There's nothing in here. So I'm going to create the begin play on Event Begin Play. We're going to create widget, and this is going to be
the Character BP UI. Then from here we're
going to Add to Viewport. There we go, compile save, and now when we play the game, okay, seems good enough. Maybe should be able to bigger. And obviously we should add a bit of space in-between these. We don't want them all
squished together. So maybe we'll select
these and just make them a bit bigger with
a bit of a bigger form. Whereas the font,
whereas the font, the font in here. So I'll make these 32. Let's compile, save,
and play it again. Excellent, these look great. I'm going to select
all of these and I'll add a bit of
padding on each, on all sides of 20.
Is that too much? I think that's too much. Compile save. All of this video is going
to be trial and error. So instead I'm going to add ten. Compile play. Yep, seems good enough. I think, you know what? Maybe let's make this eighth. Compiles HIV. I'm very picky. I think I am. I have a little ADHD,
something like that. I think it's called I
will also the problem is we're adding eight on this
side and eight on that side. So in here I'm going to
instead set this to two. And the problem was, let's set this to
eight on all sides, but on the right and left
we're going to set this to 22. Now there are closer and
this one to the left. I'm going to set
this to the floor. Let's see how close that is. On this one. I'm going to set to the right, set it to four as well. Let's see, compile save. When we play. For me to be honest, it seems good enough. Maybe we should make this
a bit smaller on the font. 30. Compile save, lay,
perfect. Okay. Now we have these,
makes sure that the collect jumps text and the general required
texts are variable. We don't need the other
ones to be variable. This is something
we did not do in the section where we learned
them, but that's okay. We learned as we go. Next, we're going to
add our progress bar. So we are going to, or actually I'll
have our health law, which is going to be a
progress bar. Progress bar. We're going to make it bigger. And we're going
to right-click in here and we're going to wrap it with a horizontal box as well. Whereas the horizontal box, horizontal box, there we go. We're going to
also add a text in here, the horizontal box. And we're going to move the
horizontal to the right. And we're going to
set this to fill. This text is going to be centered to the
middle, like this. This is going to call the or be, the text inside of it is going
to be health. There we go. Let's see how that looks. Maybe add a bit of
padding to the right, so I'll maybe a 20. Good. That looks good. I'm going to set
this to the bottom. Drag that in here, compile save, hit the
Plachy. Let's see. Okay, seems really good. Seems like it is
good enough for me. Select the progress bar. And obviously it's going to be valuable because it's
going to change. The appearance in here
are not going to change it to whereas the
actual the progress. Let me increase this a bit just so we can see
what's happening. Where we'll add maybe
a bit of Borderline. Let's see if we add the 55 just to have this
little background. When we compile
safe play the game. Yeah, there we go.
Just a little bit of background which is like
maybe we shouldn't send it. I don't know. Let's see. Well, we'll see
we'll see how that looks. Obviously, the bar is going
to fill from left to right. The marquee isn't going to anything will not
bind that for now, will bind it later on. Or maybe you will bind with
labor on the appearance, the Fill Color and
Opacity are going to be green because
this is the Health. Set, everything to 0, set it to okay. The style, the style is what I was looking for in
the background. It's going to be no tiles. The background is
going to be white. White, or the full image
is going to be also green. So said that the
green and the tiling, tiling, and we're going to remove any animations
that we have. So Compile, Save, play the game. Oh, okay, seems to be good. Let me check. Maybe we should
remove the padding. We can just add do padding. Let's see how that looks. Compile, save. There we go. I think that is good enough. Maybe just change
the health favorite. This video is already
ten minutes in, and we haven't really
done any coding. You could have skipped. What I say should've told you. I'll tell you in the beginning. The font will increase this
through 30 to compile save, lay and their results. So now we have the health,
the jumps collected. All that is left to do is
to actually bind them to something that is going to be your challenge to
find the hot to play. So add the WPP for the Widget Blueprint to the
new port from the character. I already done that. In the graph of the
Widget Blueprint, get a reference to the
character and the game mode. This is important. Bind the gym text to
the proper variables, and bind the progress
bar to the health. Finally, clean up all
this screen printing. This is very important because
we don't need it anymore. We have everything
displayed to us properly. Pause the video right now
and go do the challenge. Okay, so I'm going to compile, save and in the graph and
the event begin construct. I'm going to get character. I'm going to gas Character BP. Bp, my character. I'm going to promote
this to a variable and call it my character. After that, I'm going
to get Game Mode. I'm going to ask
to my game mode. I'm going to promote this
to a variable which is going to be my game mode. Compile save. Now back in the Designer, I'm going through this
very fast because I feel like we've done
this so many times. I'm going to select
gems collected, scroll down to the
text, had the bind. So these are the
jumps collected. So we're going to select the My character and
the collected jumps. Next we're going to select
the chance of required. And in my game mode, this is going to be the require
the gems compile, save. Then go to the progress bar and scroll down until we
find the percent. Select my character,
and we're going to select the health compile save. And now when we play the game, we should see that we have 0
out of one jumps collected. And one we pick up the gems. There we go. How cool is that? The final thing that we
need to do is to make sure we don't have
any printing anymore. So in here on the Health, we are going, oh, we
forgot to test it. The half. There we go. We get it whenever we are standing on
the spikes or get damaged. So I'm going to remove
the printing in here, lay the sound and remove the
printing from here as well. Just drag this up like this. There we go. This is the
first thing we are going to remove and we have
anything else in here? No. When we pick up a jump to take
a bit of time in the gems, the content, germ, pick
up jam, printing in here. Do we have any printing leaves? No. No printing apparently. Not sure about that. Let's see. I hit the F9 right here, so this is pretty simple. So print, no good
and fine print. Back in here. What else do we have
when we start the game? Okay, so when the game mode, Let's find the print. Print string. Remove that. Do we have any other
prints there we go. Normal prints for you. And we're going to move
this as well, compile, save the character and the VP, my character and on the gems
and three hit the Enter key. Let's see. Yeah, I'm pretty
sure we didn't find anything. We still have something
whenever we okay. So jams collected there we go. Compile save. So now neither the health more or the gems are displayed
when we play the game. There we go, we have
a much cleaner world. And when we pick up
the jump, there we go. Everything is working fine. Thank you so much for watching. I hope you enjoyed the video. I hope you'll add your
own touch to this. And if you haven't already, this is the perfect
time to leave me a good review if you think I
didn't do a good enough job, I'm wondering why you got to why you've gotten
this far in the course. But if you do think I
made some mistakes, something that you
need me to improve, please contact me and I
will try to change it. My goal is to always
keep your satisfied and provide you with the best
learning experience possible. Thanks so much for watching. See you in the next one.
67. Creating a Main Menu: Welcome back, my fellow
game developers. In this video, we
are going to be learning how to
create a main menu. Right now when we
start our level, we are again, we don't
just start at our level. We start in the main
menu where we can quit the game or we can play the game with a very nice-looking fall. Obviously these UI elements of the character we will
need to remove later on. But if we had the late game, you'll see that we go to the
level 0 that we always had. And if we quit the game, we quit the game. There we go. Let's not waste anymore time. I know this is a
very long video, but you can really, you can skip the
parts where I create the UI elements and do
your own if you want to, or you can just get a
couple of ideas from me. So let's not waste any more
time and let us get started. So time to create our main menu. The first thing we need to think about is the background
of our main menu. So whenever you start again, you always have some
kind of background to represent what the
game will look like. Now this can be several things
that this can be an image, this can be whatever you want, but I prefer to do
is have the game that we are actually going to
play to be the background. What I'm going to do is I'm
going to go to the content, select the level 0, duplicate it, and call
it the main menu level. I'm going to go to the main
menu level, Save Selected. Now in here I'm going to choose some kind of
direction to look at. Now, a couple of ideas
that you can do. You can, for example, select removal of these, select a couple of moving platforms and set them
to be moving that way. When we start the main
menu you have the platform is moving with spikes
on the ground. Or you can set that
to be looking at those cubes in this ominous way. Or you can just have
everything together looking like some kind
of like this angle, for example, in the game view. So it really depends
on how you want your game to look
like. That's it. How you want to
remain money to look like for me to be honest, I think I'm going to
choose some kind of angles similar to
maybe like this. Just have a general
view of everything. Moves the platform right here. Move these to the side like from here to maybe hear
something like that. And just set the
platform to be on. And that's it. I guess this is how I would
like to see it. There we go. We're going to start from this position, this
exact position. We are going to go into
the content browser. We're actually, what I'm
going to do is I'm going to get the, there we go. So select the player, start, right-click on the player, start and pilot the
player stopped. So now we are flying the
actual player start, which is going to set our
game exactly where we want. Once we set it in here, then we are going to
click on stop piloting, and now we will have our player. Now the problem is when
we start the game, you'll notice that we fall
down, which is not good. We don't want that to happen. So instead what we'll do is
we're going to get one of these platforms and move them to be around
here somewhere. I'm going to simply maybe move
the gems to one of these, setup it right here to be
in front of the player and let me remove the spikes. I'm going to move
this platform to be under the player whenever we start so that
he does not fall. And you'll see why, because
later on our player is not going to be moving at all. So there you go. Let's see how that looks. We don't want him
to fall at all. Move them up and move
them to the side. There we go, so we don't see the ground whenever
we start playing. So now when we play
the game, There we go. This is how we will
see our level. Excellent. Control S to save, Control Shift S to
save everything. And now we're going
to go in here, go to the content,
open up the UI. We are going to create a
new Widget, Blueprint, which is going to
be called the WB P underscore main managed. By the way, I forgot
to do something. This should not
be called the BP, this should be called the WPP. Maybe I did that before. Whenever you are creating
a Widget Blueprint, it's called WPP
Widget Blueprint. So open up the Widget
Blueprint menu. And in here I'm going to do a couple of things a bit fast. First of all, I'm going to
get a blur, background blur. I'm going to set
it in the middle. I'm going to set the anchors to be this one on the
left and right. I'm going to reset
the positions on the x and y. I'm going to
reset the offset on the Right and the left. I'm going to see if I can
change the size of the sea, of the x, the y, and that's not what
I wanted to do. Maybe the position on the y is something
that I wanted to do. Increase the y as much as I can, change the offset to
be 0.5 on the x and 0.5 on the y or key seems to
be great size on the, why? Is there more size on the x? C offset to the right. Okay, so there we go. We set this to 0, and
now we have the Sway. We can increase it a bit. There we go. We have the blog blur. Next, when we scroll down, we should see somewhere that
we can change the blur, the amount of blur. If I can solve their strength, I'm going to set
this to maybe 0.8. I think eight. Let's see, compile. Okay, we can't see, we
can test this next. Later on. We'll test this. I think this is fairly four will be fair enough and maybe
increase the y a bit. Actually, no, what? I have
the value in here somewhere. So 0.3 should be a good one. Inside the other, the blur, we're going to add an image. So I'll drag the image in. The image should be
completely dark. There we go with an
alpha of 0.3 head. Okay? Next we're going to add
two more background blurs. Background blur. This one is going to be
anchored to the top. We're going to reset the offsets on the
right and the left. Make sure that this
one is 0 and set the size to be much bigger. And reset the position
and set the size and the y to be a big just to
cover everything else, this blur is going to be a bit less than the one
that we had in here. So let's just set it to 0.5. The one that was here
was let's set it to two. I don't know. I'm not sure
to be honest with you. Pass these out. These are the
things that we can change. They're not that big of a deal. They just add a bit
more authenticity. Reset the position on the y, and we're going to set the
offset on the y to be one. There we go. How
perfect is that? And the blur is good. Compile Save. Next we're going to add
a bottom. There we go. So add a button in here. So we cannot add
it to this image. We will simply add
it to the canvas. We're going to set
it in the middle, recently positions and reset the alignments to be 0.5 by 0.5. So it's completely
in the middle. Let me zoom in so I can
grab the edges a bit. There we go. So this
is our first button. This is going to be
the play button, and I'll duplicate it
and this is going to be our IT button. And maybe I should put them in a horror
and the vertical box. But for now I'm just going
to leave it as it is. And I'm also going to
add a text in here, and this is going
to be our title, the title of our game. There we go with added
on the canvas panel. We'll also set the
alignment to be 0.50.5 with an anchor
in the middle. Reset positions with
a bit of a bigger, oh, actually that's
size to content. Let's make this bigger. And actually we won't
need to do any of this because we are going to be
adding our own thoughts. So I'm going to show you where
I got the Cyberpunk font. Go to fonts for free and
you'll get the Cyberpunk. You can either use this
one or use one of these on the Cypherpunk on
the left, fund.com. So I'm going to go back and non-real the Content
Browser and the content. I'm going to go to
the resources that I have in here and drag this one. It will ask me to
create a font italic. Yes, please look,
create a font for me. So now we have
this font back in. Let's close this one down
back in the main menu. The font, we're going to
select the cyber punk. How cool is that, ladies and gentlemen, Now, this is what I call
a freaking game. Looks amazing. This one is not moving
for some reason, so I'm going to reset the
position on the x and reset it. Let's keep it for 120
and move the note. No, no, no, no, no, no. Let's make this for 2069. They really do it
for some reason. It is the perfect number, 420 and our case, I mean, 69. And let's move the
position down here, and let's select this one
and move the position on the y that I make
something wrong. The position on the y down here, there we go. This is our texts. We are going to the
typefaces the same. The size as 94, I guess that's okay. Maybe move the position
that a bit up. Like this. We're going to
change the color to be this kind of yellow. Okay? And then we will add a
bit of shadow which has, which will have the color red. And we'll add a bit
of offset to it. So an offset to the
right and opposite down. And we need to set
this one to 0.5. Yep, there we go. And now we need to
adjust the offset a bit. So there you have it, ladies and gentlemen,
How cool is that? Now we have this nice tax
that is in the middle. And we're going to
change this text obviously to as the game called cyber spy 3027. Okay, So obviously we don't
have numbers in here anyways, let's just call it cyber spy. That's okay. You'll
forgive me for that. Compile, save for some reason the numbers just didn't work. I tried my best. Cyber spy, 2037, so we
still can't see anything, but this is basically how everything is going
to look like. Next, we're going to add a
text block to the Play button, a textblock to the Quit button. And this textblock and this textblock are going
to be both cyber spy font. Both will have the yellow color. Both will have a shadow offset of 0.8 and being completely red. And we'll add a bit of
shadow offset in here. Maybe. What was the shadow
offset on this 1910? Let's just set it to 99. These texts. Text. Who both had a shadow of 99. How does that look too much? 33. There we go. Or maybe we don't need
any shadows on this one, or maybe we should make them completely black. There we go. I guess that's good enough. So they regard the text. The text on the blocks
look good enough for me. Now, the next thing we
need to do is we need to actually set this
in the view, or sorry, we need to change this to lay this one to quit. There we go. So the queue
is very ugly by the way. And maybe we should
make this a bit bigger. So maybe change this to
30 to their records or compile save and this font also I feel we can make
it a bit bigger. So 110, compile save. And now I'm going to issue a challenge to send
the main menu. So add the main menu to the viewport in the
Level Blueprint makes sure when we
press the button and we could again, also, you'll notice that we
still move around once we click stub that when WPP is constructed and get
the player controller and send the input mode to UI only and the widget
to focus on self. Finally, we need to
see our mass simply acts as the player
controller and shed set V, show cursor to true. So pause the video right now. This challenge will have multiple nodes that you need
to discover for yourself, but I'm sure you can do that. Pause the video right now
and go do the challenge. Okay, So in the main menu, I hope you did the challenge. I hope it wasn't too hard. We're going to open up
the Level Blueprint. And what do we have in here? We don't need the sound at all. Yes, we're going to remove this. Almost this as well. We're going to begin play. Scroll down. We're going
to create the widget. So create widget. We're going to create
the main menu. And from the main menu we're
going to add two viewport. There we go. Compile save. Now when we play the
game, there we go. We can see our
beautiful new screen and I think we need to
add a bit more blurred. So on this one will make
the blur maybe five. On this one, I think the
eight was a proper value. This one will set
the layer to be. Let's see how that looks. Play the game. That too much. The black isn't black enough
on the image I feel anyways, we're wasting a lot of time. And I'll just keep moving. Compile, save, and we'll sort
the other things later on. Next we need to set
the Quit button. So I'm going to click on the
button and clicked in here, we're simply going to quit game. That's it. Bile save, play with the game. There we go. It works. Now. The next thing we're
going to do is we're going to actually
set the input mode. Because when we play the game right now if I click in here, you can see that I can still move and I can still fall down, which is something
that we don't want. Plus we are no longer able to see our mouse cursor, cursor. Let's solve these things in
the Main Menu level in here, in the Event Begin construct. So do we have it not be gone. So begin construct,
construct, cos truck. Oh, I'm looking in the
wrong main menu levels. The onclick event
construct that was like. So. I will try to cut that
out to not look stupid. Anyways, in the Event Construct, we're going to set input mode UI only and the player controller, we are going to get
layer controller. Now if you want in here, you can cast this. I do recommend that you cast it, but honestly we don't need to. We only have one
layer Controller. Next thing we're
going to do is we're going to set the mouse cursor. So from here we're going
to set mouse set moles, okay, but this will not work. We need to get the
player controller set mouse cursor, cursor, cursor. There we go. Show mouse cursor. Set it to true. Will just there, the
butt right here, just so we can probably
see everything. Move this a bit to the right. Finally, we need to select
the widget to focus on. So this is going to be the Self. Why is it the self? Because we are
focusing on ourselves. We are working in
the main menu widget and we'll focus on this one. When we play the game, you'll see that
even when we click around or we tried
to walk around, it does not work. We can play the
game that doesn't do anything and we
can quit the game. Now, let's finally
create the play buttons. In the main menu designer
go to the button, which is the Play button. And by the way, it's
better to call them. So instead of just bottom one to four discovered
the Play button. So unclicked. In here we are going to simply first of all
set the input mode, set, input mode game only. So it's no longer
because keep in mind when we are
in the main menu, we are setting the
game mode to your eye. So now we need to turn it back. Get player controller. There we go, compile save, and we are going to open level. So open level, we can
either set it by name. That way we need to get
the string reference, we need to copy the level name. Or we can open level by reference where we
can set the level to open, which is going to be level 0. So we'll compile save play. We can't walk around. We hit the play button,
and there we go. We are in level one and
everything works perfectly fine. Thank you so much for watching. If you have any problems,
just adjust them. Make your design as best
as you want it to be. Sorry for the long video
of these things take time whenever we are
creating widgets. Thanks so much for watching. See you in the next slide.
68. Creating A Pause Menu: Welcome back, My favorite
game developers. In this video, we
are going to be creating our pause menu. We walk around,
we pick up stuff, but then all of a sudden
somebody comes into the room or your mom calls
you and then you're like, Oh wait, let me pause the game. When you pause the game,
you'll see that we can no longer move around. And we can either go
back to the main menu, which takes us to the main menu, or we can, for example, go and resume the game. When we resume the game, we continue on playing
as everything normal. So let's not waste any more
time and let's get started. Okay, So in this video, we'll create the pause menu. Let's go ahead and get started. We're going to first thing
is we're going to set the first level that we
load into the main menu. So I'm going to
go into the file, I mean in the edit and
the Project Settings. And here we're going to
find maps and modes. And we're going to change
the editor Startup to be main manual level and the game Default Map to be
Main Menu level. This should be saved without
us pressing anything. Now let's actually
move on to the main. Actually, no, not the
main manual level. What we are going to do is
we will go into the content. We're going to go into the UI, select the Main Menu
and simply duplicate it and call it the pause menu. So WPP underscore pause menu, open this baby up. And it's going to be pretty
much the same except for the cyberspace in here is
going to say game paused. There we go. On the Play button. The word play is going
to be called the resume. Resume game. And instead of quick game, we're going to quit main menu. Let's see how that will look. Yep, I knew that it's
going to look that good. What we'll do is we're going to, so you have two options in here. You can either make the
button a bit bigger or make the font a bit smaller
to fit inside of here. But what I'm going to
do is I'm going to change this to main menu. So much simpler, easily handled, and everything should
be good enough. So Compile Save. Now the next thing we need to do is we need to actually make the game unpause and go
back to the main menu. But before we do that, we need to actually
pause the game. And if I remember correctly, I think we already created in the Edit Project in the
inputs. Yep, There we go. We already have a pause button set up in the action mappings. So I'm going to go to the
character controllers on the content in
the FPS character. The BB, my player controller. In here, we should create input action mapping
for the pause. Let's see bars
action, pause, event. No, we want the
event. That's it. This was the one that
we were looking for. I'm going to set this
up somewhere in here. When pressed, we are going
to set again, paused. There we go. We're going to check
this to be true. This means that the
game will be paused. Then we're going
to create widget. The widget will create
as the pause menu. We're going to add it to
the viewport. Viewport. There we go. Now we compile, save. And when we play the game, when we're walking around, when we hit the P key, we should see that we
have pause the game. We cannot click anywhere, and we can only either resume the game or go back
to the main menu. But obviously, these
buttons do weird things. So for example, when
we resume the game, we start from the
beginning because the resume game actually still has the same functionalities
that the late game had, which takes us to the level 0 and the main menu
quit the game. So it's time for a bit of a
challenge to resume and quit. So first of all,
instead of quitting, we want to go to the main menu. And when we resume, we want to do the following. First of all, we move
the widget from parents, so basically removing
it from the viewport, but we use the
Remove from parents. Next, we will set the input
mode back to game mode only. We will hide the mouse cursor. And we are going to
unpause the game. Pause the video right now, and go do the challenge. Okay, So I'm going to
go into the graph. In here we have the quiz game. This is the button that will take us to the main menu store. So instead of quitting, I'm going to open level and let's just use the
reference by name for now, even though I don't
recommend it that much. But we'll use this one
since we've already used the get object
by reference, we'll use this by name. Whenever you are handling
string references, you always need to make sure
that you go into the levels. You hit the main
manual level head F2 key in order to
change the name, copy, then go back in
here and based in here, so make sure that it
is exactly the same. If you don't, if you have
some kind of different, like if we forget
the e For example, example or set the
L2 not be uppercase. This will not work. This will cause an error. Compile, Save. Now the next thing is in here. Whenever we resume the game, this is going to be
the Resume button. I presume. I think that's pretty much it. What wasn't here? Set game. Okay, so there we go. That is it in here. First thing we're going
to do is we're going to remove from parent. This will remove our widget. Because we are targets the self. That means it's
targeting the widget that we are working
in right now. If we didn't, if we weren't
working in this widget, we needed to have referenced the widget that we want
to remove from Parent. Next, we're going to
set input game only. That way we know that we
can only access the game. And we're going to set
the player controller. So get player controller. And as I've told you in here, it's preferred to
use the casting to make sure that we get the
proper player controller. But for now that's okay. Just to save a bit of time, actually meet
explaining to you this doesn't save time,
but that's okay. Next we're going to
set mouse cursor. So we're going to
get it from here. Set mouse, cursor,
mouse, cursor. Know this is the widget, this is not what we want. Let's see. Mouse cursor. Okay, So get sacked, mo, sorry, sorry, sorry. Set mouse cursor. There we go. Set show mouse cursor. As you can see, I'm also making mistakes sometimes and we're going to
uncheck it that way. We no longer see
the mouse cursor. And finally, we are
going to set game balls. We're going to keep this empty. This means it's false. That means we un-pause the game. So Compile, Save. Now when we play, we walk around,
we'll hit the P key. There we go. When we go to the main menu, there we go, we come back
to the main menu level. We play the game, we pause, the game, will resume the game, and we continue walking around, hit the P key again, presume the game and everything
seems to be perfect. Thank you so much for watching. What I want to do
is I want to remove this little edge around the
Sun here in the next video, I shall remove the edges around this Health Bar because they
launched really look nice. I thought it would
look much nicer. So thanks so much for watching. I hope you enjoyed
the video and I'll see you the next one.
69. Damage and Collection Effects: Welcome back, my fellow game
developers in this video, when we play the game, when we go to pick up the gems, you'll see that we have this
flash of the yellow playing. Now, not only do we
hear the sound and we see the jumps collected,
owe collector. That's a mistake I made. Sorry. Not only do we collect
gems at the top, but we also have
this flash of red and flash of yellow
that gives us a better indication
of what's happening. So let's not waste any more
time and let's get started. Now when we collect a
jump or when we get hurt, all that we have
is a bit of audio, which is good, but
it's not enough. I think we need to have a more, let's call it a more physical way of understanding
what's going on. Maybe physical is
not the right word. I don't know something that is flashy, that's the right word. So first of all, we're going to create
the damage effect. So I'm going to go
into my character, into the contents FPS, and open up my character. This is where we are
collecting gems and getting hurt in here in the Event Graph. First of all, I'm going to
create a variable in here, which is going to be show, damage, effect and compile. And this by default
isn't going to be false. And whenever we get damaged, where do we get damaged? When? When do we
get damaged goods, game play sound okay,
getting damaged. So in here, just
before we delay, what I'm going to
do is I'm going to set the show damage effect. Let me drag this in here. So write like this. We're going to set it to true. We're going to add
a delay of 0.3. And then we are going to
get the show damage again. And we're going to
set it back to false. So it's that simple. As soon as we get hurt we hear the sound will show
the damage effect. With delay 0.3, we turn
off the damage effect, so we, we no longer see it. And then we go back to doing what we were
doing previously, which is resetting the
damage that we can take. Excellent, so Compile, Save, That's all that we need to do. Next, we're going to go
into the character UI. I'm going to close down
the player controller and the bars manufacture now go
back and the character UI. We're going to add a border. This border, we're going
to anchor it to all sides. So on all sides, we're going to reset
the offset to the left. We're going to reset the offset, the top to the right and the bottom and make sure
that all of these are 0. So we cover the entire screen. We're going to set the
z order to minus one. So everything is in front. While actually, yeah, everything is in front of the border. Going to change the
color in here to be completely red. There we go. That didn't do anything
for some reason or case over changing the
content that's inside, we're going to change
the appearance. So we are going to turn
it completely red, but we're also going to
change the Alpha to 0.2. So we have this faint red color. Next we're going to
bind the visibility. So if we search for the visibility right
here, compile save, we're going to change
or we are going to bind this to a
certain condition. And that condition
is going to be the damage whether
it's true or not. So we already have my
character in here, somewhere. There we go. This is my
character. We're going to get it. We're going to show or
get show damage effect. Show damage effect. There we go. And based on that damage effect, we're going to create a branch. On that branch will add
the condition right here. And if it's true, it's going to be visible. And we're going to create
another return node. If it's true, is divisible. If it's false, we want to make
sure that it's not hidden, that it's collapsed because we don't want it to
be in front of us. We don't want to
have, whenever we click on the screen to
have it in front of us, we wanted to completely almost be not there at all,
not just hidden. I'm not there at all. Compile, save. And now let's see how that
looks when we play the game. There we go. You can see we have a bit of a flash
whenever we get hurt, let me turn down
the sounds in here. There we go, so
you can see now we have a better indication
of what's happening. We get this flesh flash
of red on the screen, which really indicates
that we are getting hurt and we need to get
the heck out of there. Next we're going to
create the gen effect. So back in the
character UI designer, I'm going to call this. Damage read effect. There we go. I'm going to duplicate
the damage rate effect. I'm going to call it the
gem collected gold effect. I'm going to select this one and I'm going to change it
to the color of the jam. So what was the
color of the jam? If we go back and the content, search for gem, that's
open up the goals so we make sure that we get the precise scholar that
we have in here. So it was yeah. Okay, so 1.90 O goes down again. No need to change
anything back in here. I already forgot the values. Anyways, let's just
set it manually. There we go. I think
that's perfect. 0.9. That's our goal. Okay? Now what we'll do in here, instead of using the
same exact method, we are going to create an animation and then play it
whenever we collect a jump. And actually I said
something wrong, we are not going to
create an animation. You are going to
create an animation. Make the jump flash, so make the flesh last 1 second and total
at the zero-point to add a bright flash of alpha may be 0.3,
depends on you. At the zero-point
for add a thymine to 0.1 for the alpha at 0.6, add another flesh and
finally take it down to 0. So pause the video right now
and go do the challenge. Okay, So how did
you get all that? I'm going to add
animation in here called the jam lash effect, or jump pickup effect. More, better, pick up effect
on the timeline in here. Let's make this a bit bigger. I'm going to make
sure I'm selected the gym collected at a track. Let's go ahead and add jump
collected effect at a track. What do we have in here? The render opacity. So before we continue on, let me go to the
render opacity in here and make sure that
it's 0 always. Then at the first, at 0. What did we say we wanted to do? Let's see, at 0.2, we
have 0.3 alpha, 0.2. We get a 0.3 alpha. There we go. So now he 0 at here we have 0.3, then 0.4 with the mid
back to one represent 0.30.40.4 with the
mid back to 0.1, the Alpha. There we go. And then 0.6, we
take it back higher, higher did you say yes, 0.3. Know what happened in here? 0.3. Finally, at
the 1 second mark, we take it back down to 0. So now we have this kind of little bit of flashing
soap compile save. And now we need to actually
call this animation. I hope you've tried to, I hope you tried to do
this on your own. I'm going to go to the pickup jump in here is where we are going to be
playing the animation. First thing we need to
do is we need to get a reference to the
gym being picked up. How are we going to do this? Well, we are going to, while there are obviously many
ways that we can do this, but one of them is like looking for the get
actor of class. So from here I'm
going to get widget. You can see that we can
get all widgets of class. Now this returns a, an array of all the
widgets that we found off type character UI. So what we are going to
do is we're going to get a copy was the reference 0 because we know that
we only have one. So we're going to get the
first element that we find. And then I'm going to
promote this to a variable. This variable is going
to be our character. You are widget. There we go. So now we have a
reference and let me just it go over
this one more time. So when we begin play for
every pickup, the gym, we are going to get all
the widgets of class because we can't just
get one widget of class. We will have to look through all the widgets off
glass WPP character. Once we find an array of them, maybe there are ten. And because we know
that we only have one, we're going to get the first reference in
here if you just want to make sure 100% that you're
getting the character. Your eye that you need, you can simply gas this
to your character UI. That would be a great idea. And finally we promoted
to a variable. So Compile, Save, now
we have a reference. The next thing we need
to do is whenever we actually get picked up in here, before we destroy the actor, we should play the animation. So what I'm going to do is I'm going to instead of
play the animation here because this is not the
pickup gems job to do and the character UI in the graph, I'm going to create a function. What is this? Get visibility. This is the, okay, so we'll call this
function flash damage. Flash effect. There we go. Or setting
damage, flesh effect. No, I don't think that's
the proper name for it. We should set the
set damage effect, visibility, better name. Then I'm going to
create a new function. And this function is
going to be the play JAM, flash or pickup
animation pickup. Mention. Here. All I'm going to do
is I'm going to get the pickup jam and
to lay animation. And the target is
going to be the self. So compile, save everything
in here should be good. Now back in the pickup jam
before we destroy the object, we are going to get the
character widget UI. And from here I'm going
through Play Animation. No, not like that. We're going to lay
animation the function. So play, play jump
pickup animation. There we go. Set it right here. There we go. Compile, save. And I hope you understand
what's happening in here. So first of all, we got
the character UI widget. By using the get all widgets
in the character UI, we created a function
that will play the animation pretty
simple. Why did we do that? Because we need to make sure we could have just simply play that
in the pickup Jim. But it's better to understand how high-level
programming works. Whenever you have something
that needs to be done, it's better that it's done. It's proper place. So we don't want the pickup Jim to handle playing
the animation, even though it's almost
the same amount of nodes. But still, you need to have a proper hierarchy for
what everything does. Sometimes we want, we
might not do that, but it's always
better to focus on having these good
programming habits. So we play the animation
function where we call this function right here just
before we get destroyed, whenever we get picked up
by the player character. Compile, save. And now when we play the game, we should see that when
we pick up the jam. Nice, How cool is that? We get a bit of
animation when we get damaged and when
we pick up jumps. So thank you so
much for watching. I hope you enjoyed the video. I hope you did the challenge
and I hope you are sometimes trying to do those things
without me telling you to do, such as playing the
jump animation. That's what they have
been really cool. Thank you so much. See
you in the next one.
70. Death Screen : Welcome back, my fellow
game developers. You might be wondering, why does it take so
long for us to die? Well, because there are, or there were many
things that we need to handle when we died. Right now, we walk around, we jump, we do whatever we want. But once we die, there you go. You can see we have
a bit of a shake. We have the screen flashing
slowly in front of us using an animation and we get
the text down here, press Space to restart level. When we hit the
spacebar, we are back. And also notice that we
cannot move anymore. So thank you so
much for watching. And I need to say that at
the end of this video, let's not waste any more
time and let's get started. Okay, so let's go ahead
and create a death screen. I'm going to go into the
content browser in here, and we're going to go to you. I will select the pause
menu, will duplicate it, and we'll call this
the death menu. Open up the menu
and the game post. We're going to
change this to die. There we go. You died. It doesn't look that pretty. I think it does
the work for now. And in here we're going to create one button
that's going to be main menu and the resume
unlocked if you want to have like a two
buttons or one button. This one will be
the restart game. Restart level, actually
restart the level. The one down here
might be a main menu. If you want to return
to the main menu, I think that's a good idea. So I'm going to select this
text in here and make sure that the justifications are in the middle so it doesn't run, run out, Compile,
Save. And there we go. So we have the restaurant level, which is a bit bigger
than the buttons. So I'm going to make this
button a bit bigger. Let's see how big
is this button. Scroll up. Again,
wasting a bit of time. That's so K, so it's 574. Okay? This one shouldn't be 574. We no longer have our magical
numbers, so Compile, Save. Okay, so now let's go ahead and change everything
that we have in here. First of all, we have
the background blur, which is on the top
and on the bottom. That's good. The image right here, I think we will maybe
change this a bit. So I'm going to make this
whole thing completely red and maybe change
the opacity to 0.5. There we go. And we'll increase.
Okay, thank you. That's good enough. And you know what, let's
delete this background blurs. Let's anchor this background
blurred to all sides. Let's reset the
position of the top and the bottom and move
this one up a bit, maybe make it a bit bigger. Let's see an increase
the font size. Yeah, you got extremely scary. And the buttons that
we have in here, we'll just keep them in
place and I think that the background isn't good way. Second, there we go. The opposite on the
bottom should be 0. I'll move this down
a bit so we can properly see what's going on. Okay, so there we go. You dive either we restart the level or we go
back to the main menu. And maybe I'll just move
these down a little bit. No, it doesn't work like that. No, not like that. Maybe move this right here. This button right here. So the main menu
button will stay the Main Menu button and we will not need to change anything. But obviously the resume
wasn't needs to be changed. Or actually know what. Let's try something different. Let's remove the
button completely. Go back into the graph. Remove everything relating to the restart button,
compile save. And instead the designer, I'm going to also let's
remove the main menu. I won't need it. Why do we need it? We'll try something different this way we will learn more. Take advantage. So you died, Let's
duplicate the EU died. In here I'm going to say
press Space to restart. Level. There we go. That's a bit big, so I'm going to make it big and
the background, we need to change
the shadows on this. So color and opacity,
that's the same. Whereas the shadow, the shadow should be completely black. There we go. So set everything to be 0. And this one as well. The shadow should be 0. Everything, there we go. So now you died. Press Space to
restart, compile save. And if you want,
you can wrap this. I'm not going to draw that. I don't want to
waste anymore time, compile everything and save. Now back in the graph. You might be
thinking, well, okay, let's just get the space-bar pressed and whatever
and we can continue on, but it is not that easy. What we need to do
is we need to get layer controller from
the player controller we are going to set this was, was input key just pressed. And there we go. And that was just
press the space bar. We're going to create a branch. From this branch, we are going
to attach it right here. Let's move this down a bit. We have a bit more space. This right here and
the event thick. So like this. There we go. So on the branch, if it's true, then what we're going to do
is we're going to do once. Just think is. So we press this multiple times by mistake and we're going to get current level,
current level name. There we go. We're going
to open level by name. Nope, I wanted to
do it like this. So open level by
object reference. Let's see what that work. No, it won't. Try. Another way. Open level by name. Let's see if we
can convert this. Yep, there we go. We can. I think we had that before, but I just chose to ignore
what's happening in here. We get the player controller. We check if the space bar
where we selected right here, we check that the
space bar was pressed. If it was, that means
this one is true. That means we will do once get the current
level that we're at. This will give us a string value that we are going to put inside of the name and we are converting it because
this takes in a name, not a string, so we'll
need to convert it. So Compile, Save. We will not be
able to test this. Now, what we want
to do is we don't want to just have this
flash in front of us. We want to have some
kind of animation. So let's create a new
animation in here and call it the depth screen. Appear. On the depth screen appear, I'm going to select
the canvas and I'm going to add a track
for the canvas panel. It's not going to be
anything too fancy. Simply add the
render opacity and from ended will take us
about 0.8 seconds, maybe. From the 0 in here, we're going to set this to 0. And at the 0.8 volts,
set this to one. So there we go. We will have this
you compile save. And we'll just click and see you on the canvas panel later on we should
set this to 0, maybe on the render. We'll see how that will look. Let's also create a
camera shake when we die. So back in the level 0, the content, Where
should we create this? The spikes, maybe in the spikes. No, spikes is a good place. Let's see, let's see,
let's see where should we create a square that
we create this shape. Let's see, shake, shake walk. Whereas it, whereas this, it's in the blueprint
class FPS character. Yeah, I think that's
a good place to do it because the FPS character is the one that's
going to shake. So I'm going to duplicate the
WPP or the BP walk shaking and call this the shake. There we go, the death
shake, open this up. The oscillation
duration should be 0.5. There we go. 0.5. Blend in. What's going to be 0.1. The blend out should be 0.4. And by the way, I have
all of these values. I'm not just playing around. I've already tested
a couple of these. Maybe we'll change them up. Now we'll add a bit of rotation. So on all sides will
add four and forty. Four and forty and
we'll use the random. And we can also set
this to Perlin noise. There we go. Let's set
this to Berlant noise. That way we have a
very shaky world. You know, it's going to
be chaotic when we die. And then we'll also add
shaking on the x and y. X and y on the amplitude
and frequency. Oh my God. Okay, so
that's our settings. If you want to go
back, you can use your own and you can test this out. Finally, we need to actually
add this to the viewport, so I'm going to save this. Let's keep it open. So in here before you
die, if you remember, our death has been
very anticlimactic. So when we die, we
actually save for 1.6 seconds to hear the sound
and then we quit the game. Well now we will not be
able to put the game. We will have to restart. This is a bit of a problem
that I just thought of. What if you want to
just quit the game after you die or go
back to the main menu. This is able to have a
problem, but for now, let's just focus on what
we have in front of us. In here. We are going
to first of all, remove any delay because
we're not quitting the game. We're going to play the sound, but after that we are
going to disable input. So disabled input on
the player controller. Do we have a reference to the player controller on
my character? There we go. We use the player controller. We do something wrong. Ok, Know was on the other script will
disable the controller, disabled the inputs on
the player controller. We're going to create a widget. So create widget,
which is going to be the death menu. There we go. We're going to add
it to the viewport, viewport compile save. And finally we are going
to start the camera shake. So I'm going to get flare camera or manager from
the player camera manager, I'm going to start camera
shake. There we go. And the camera shake
that I want to start as the death shake. There we go. That's all that we need to do. I think. Now if we
go ahead and play, we should see that
is everything good? And let's just make sure I feel that there's
something missing. Missing that we did not do. Okay. Play the game. Now when we die. Okay, so I suspect
that this would happen because it did not just
play the animation. Hey, welcome back guys. So there were two
problems with our deaths. First of all, when we
play the game of weight, because I changed things. So first of all, I'm using
this gap player controller. We will be using this one happening in here
when we compile, save and play the game. I am walking and I'm dying. We have the camera shake, but we don't have the slow
animation playing for the UTI. This is the first thing we
forgot to play the animations, but there's an even
bigger problem. And that is that we
have this mouse cursor. If we go back to my
character, first of all, let us go back to the
test menu in here, you'll see that
whenever we are dying, we are actually setting
the input mode to you. I only we don't want to do that. We're going to
delete all of this. And instead what we're
going to do is we're going to get the
depth screen appear. And we're going to
play the animation. There we go. We simply, as soon as we
create this event construct, that means whenever we create the blueprint of the desk
menu on the event construct, we are going to
play the animation. So Compile Save. Now when we play the game, should see when we die
we have this fading in, which is very nice. But the problem right now is that we are no longer
setting the input. We still can walk around, even though in my character we've set the input
to be disabled. Now, the thing that I didn't do properly here is
that we need to also connect the player controller
to the target because this is the object that
needs to have its inputs, the stabled, because otherwise
the target is the self, which is the actor,
which is the character. And we are not doing
anything in here. We compile, save
now that we have the target set as the player
controller when we play, we should see that
we are still moving. But this time when we go out, we get this error. This error does that. We've access none trying to read the property of the my
controller blueprint. And if we go back in here, you can see that it's
in my character and the graph node in the event of
graph and the disabled input. So if we click on the disabled
input, this is the one. Why is this happening? Because my player
is going empty. Why is that? For some reason, the player controller in here, I'm trying to find it, but we cannot find it. So it's in the FPS, my character, but we are
not setting it anywhere. We're just using it. Maybe we created this variable somehow and we are not using it. So what I'm going to
do is instead I'm going to whenever we
begin the events. So on Event Begin Play, we set the viewport
and we're also going to go ahead and set
the player controller, which is going to get
layer controller. We are going to gas to
my player controller. We go, I forgot that
we also need to have this connection right here, so I'm not sure
where we did that. Maybe I should go back
and watch a couple of videos just to make
sure maybe you do. I really hope you do. If you have any questions, please leave them down most
probably I'll find them. Maybe I'll add another video to explain why we created
this variable. But anyways now what we should see is once we add
this to the target, and we add this to
the controller, we compile, we save, we play the game. We go outside, we
die. There we go. We can no longer move. We can no longer walk around, but we, if we hit the spacebar, will restart the level. Now, you might have
noticed something and that is that we
are still walking. So I'm going to issue
you a challenge. And your challenge
is going to be to stop the camera shake. That's it. That's all that you need to do. So pause the video right now and go stop the camera shaking. Okay, So it's pretty simple. If we go back to the
my character in here, the game over when we
disabled the inputs, we can also let me
just move these. And since in the
player controller, if we go to the player
controller in here, player controller, we have this stock camera shake events, so we can call that immediately from the player controller. So stop camera. Shake. There we go. Attach it like this. Up, set it in-between,
Compile Save. Now when we play the game, we should see, there we go. We don't have any more shaking, but you can here we
still have the walking. These are things
that you might not suspect are going to
happen, but they do. So what do we have in here where our replaying the walking, so input actions sprint,
the steps sound. What I'm going to
do is I'm going to, where are the steps sound? Let's find them. Steps sound. Let's see. In the event the graph gets
step sounds, set the volume, Okay, and in here also
the whole component. Okay, great. So what I'm going to do is I'm simply going to create some kind of add custom event. Steps, sound, kill steps sound because I'm very angry and I want to
freaking kill them. Get the step sounds. And we're going to set
volume multiplier 0. There we go. Compile, save. Whereas it in my
character when we die, we also want to kill. Please freaking kill it. We can add a sequencer
in the year, maybe. We'll add a sequencer. Sequence. It's not necessary, but just to have a proper flow. What a sequence is
a very bad idea. We're going to add this
in-between stopping camera. There we go. So as
soon as we die, we disabled the input. We kill step sound, we stop the camera shake, we compile, we save
and replay the game. And hopefully right now, we got, we have
the perfect death. When you hit the spacebar, we restart the level. Thanks so much for watching. I hope you enjoyed this video. Sorry that it was so long. Sorry for a couple of mistakes
and things that I forgot. If you have any questions, please leave them
down in the Q&A and the discussions we or you can ask them over
the Discord server. Thank you so much. See
you on the next one.
71. Fade In And Out : Welcome back, My favorite
game developers. In this video, we are going to be taking our game a little bit to the next level and
the aesthetics world. So as you can see, we start our game. We can either play or quit. And if we play, you'll notice that we have this deeming and then
fading. And wherever. When we play, once we
die, there we go, we die. We press the space and it's not immediate like
we had before. Now it takes its time. It has a fading in
and fading out. Everything is good,
everything is amazing. Congratulations on making
it to the last video. Let's not waste anymore time. Let's get started. Okay, so now that we have
everything set up, almost everything is finished. We need to focus on making our game a little bit
better by adding a fading in and out
because I don't want to just start the level
immediately or when we die, just restart the
level immediately. I don't like the short. It's better to have like a small fading in and fading out. So let's go into the UI. And in here we're going to
create a new blueprint Widget. Blueprint will call the
WPP underscore, fading. In. Hit Enter. Open this one up, and we're going to go ahead
and add an image in here. This is going to
be pretty simple. We're going to anchor
it to all the sides. We're going to set
everything to 0, suddenly fill it up all the way. Going to make this
completely black. And then we'll add
a second image and we'll make this
one completely white. So we'll have to failing in or actually know what
we will not require. The fate will only
need the black image. So we're going to create
two animations in here. First 1, first 1 is going
to be fade in black. The second one is going
to be fade to white. On the fade to
black, I'm going to add a track for the image 0. This is where we
are going to select the render opacity on
the timeline and we are going to set it at the
beginning to be completely 0 and add the one mark
we are going to set it. Should we set it? Or
maybe you know what, the fate should be a bit faster. So at 0.6, we set it to one. So that's pretty good. That's pretty much
everything that you need to see where we can. For example, restart
the level and we fade to black
completely excellent. Next we are going to
select the fade to white and they track
for the image. What will happen on this one. We are going to start at
one and then add the 0.6. We're going to set this to 0. So what happens in here? We start off the level and we've paid from black to white. So Compile, Save. Now we have these
two animations, but we also want to have something to do at the
end of a fade to white. Because we are going to be creating the switch
that we are going to be setting it to the viewport and we're going to
be walking around. This widget will be in our face. So what we need to do is by the end of this we're
going to add an event. So we'll click on the track. We'll add an event
which is going to be a trigger on this event
at the end right here, we're going to add
a little plus. We're going to double-click. And now we will have
this event on the image. So let me go back to show you
what we did on the image. We added the track, we went to event, we selected eight sugar. We had this new track and we
double-clicked at the end, or actually we clicked on the end whenever
the image appears. And we clicked on the little
plus button right here. So we created this trigger. And now when we double-click it, we open it up so we have
a new sequencer event. We'll call this
the remove widget. Remove widget. There we go. We are going to simply
remove from parent. There we go and we are
going to remove self. Now we have this image
right here as a variable. I don't know why
that was created, maybe because I believe let
me just close this down. Because I believe we
made the image for some reason variable
and it came on here, but that's okay, no
worries about that. That's no problem as long as it actually removes,
removes the widget. Now, the next thing we
need to do is issue you a bit of a challenge
to create and play. First of all, create two
functions that we'll play the animations of fading
in and fading out. Next in the character,
character blueprint. And begin player create
the fading and widget, add it to the viewport
and fade to white. You use the animation
variables on your left. When we die just before
restarting the level, we need to fade to black. And finally, finally remember to delay before going
to the next level. So the fade to black
animation has time to play. Pause the video right now. Go do the challenge. Okay, so in here in the graph, I'm going to create
first variable, which is the first
function which is going to be fade to white. This fade to white, or simply
grabbed the fade to white. And we're going to
clay animation. There we go. We play the animation. Now what we could've done, we could have just selected the same animation of fading
and then play it backwards. But because I want to have the fade to white to
self-destruct at the end. That's why, by the way, you
might be thinking, Well, why are we not self-destructive
and the fade to black? Well, because the fade
to black is usually used before we move
on to the next level, which will effectively
just simply delete the widget and
start all over again. Let's create another function, just going to be fade
to get the fate black. Clay animation. Attach this right
here, compile, save. Now let's go into the
character viewport in here. And when we event we can play before we create
the widget in here, we're going to create
another widget, which create widget, which is going to be the
fading in and out. Let me just move this
a little bit, right? And from here we're going
to add two viewport. From the Add to Viewport, we are going to also select
the return value right here. And we're going
to fade to white. There we go. Attach it, set it right here. Double-click, so
we add a layer of indentation, have
everything clear. There we go. So Compile Save. Why did we use the
return value in here? Well, because it turns whatever class we've
given the right ear, we add to the viewport, we have the fading to y. And because the fading to white
as a trigger event on it, it will simply struct and
it will not be in our way. Now, let's go into where we die. So Compile, Save. Where do we die? Where do we die
and the game over. So we play the sound. But this is not actually
where we want to set it because we want to set it in the desk menu that we say
we want, we need to set it. Let's see when we die just
before restarting the level. Okay, So in the death menu, see how cooler challenges are. So right before we
restart the menu. So this is where we
restart the menu. Let me add a bit
of space in here. We're going to create widget. Widget. This widget is going
to be the fading in and out on the return value. I'm going to add
viewport. There we go. Let's move this a little
bit to the right. We'll use this to fade to black. No, this is not what we need. We need to fade to black
the function call. Yep, there we go. So attach it right
here a little bit. Finally, we need to delay, if I remember correctly. Yes, remember delay before
going to the next level, okay? So I'm going to add a delay. But how long should
this delay beat? Well, should I set it to 0.6? Well, what if for some reason
it's longer than that? Well, what we can do is we
can get the fade to black. From this fade to black, we can get the time, get this n time will get us the end
of the animation and we will set it
as the duration. So as soon as the fade to
black ends right here, this will delay until the
end of the fade to black, and then we will go to the
current level and restart. This is when we
restart the level. So that's pretty much it. Maybe we can do it
also in the menu. So we have a lot
of things in here. I'm going to remove
the dust shake the character is getting
a bit overwhelming. So in the level, where is it? Where is it The main menu? When we play the game? In the graph when we
set input CO2 level 0. Okay, there we go.
So it's in here. Should do the exact same
thing that we did previously. And death menu. Before we restart, I'm going
to select all of these. Yep, There we go.
We'll copy them. We'll go back into this one
and we'll paste them in here. No, wait, paste them
in here. There you go. Add a bit of distance. Actually set input
mode game only. There we go, That's it. That is it. There we go. Now
in here we could have maybe created all of this in some kind of function because we've
used it too many times. Two times is too many
times, but that's okay. So we'll compile save, and let's go ahead
and test all of this out because we haven't
tested anything. So when we play the game, how cool is that
we fade to white? Now we can click around, we can walk around. And when we die, now
when we press the space, we fade to black, we fade back. How cool is that? How much more impressive and you feel that you are actually
in some kind of real game. Let me go back. Main manual level,
play the game. And here, let's play the game. And obviously there is something that is not working
in here when we start the game for some reason because we're fading back
in, failing from white. But we are not able to play or click on
anything on anything. Hey, welcome back. So your boy was out there digging for a
solution and I finally found that it was
very weird because I didn't really have this problem when I was creating the course. But for some reason now
when we play the game, you'll see that we
cannot hit the Plachy, we cannot hit the Quit button. But the thing is that I never encountered this problem before. And then I noticed that
I have the health and the jump collections very
obviously in front of me. Now, this is not something new because we always had it because
whenever we didn't like, add any conditions in here
where we don't create widget character or the WPP
of the character you are. It's always there. And I remember like we use this main menu again and
everything was good. The problem was, and I
suspect what happened is that in the character UI, once we added these borders, it was no longer viable. So if we play in here, I remember I looked back
at my old project and I solved that the health and jump collections were blurry. That means they were
behind this image. So we have two viewports
on top of each other. So how are we going
to solve this? Well, because I
found this problem, I think it presents us with a very good opportunity and
that is in the main menu. We don't want to see the health or the gems that
needs to be collected. So what I'm going to do is in the character right
after we fade in, I'm going to check if we are in the main menu
level and if we are, then we are not going to
create the character UI. So in here I'm going
to get level name. From the level name, I'm
going to create a branch. If it's false. So it's not going
to check order. It's true if it's false. True. Let me just move
this down like that. Almost. After we get the name, I'm going to check if
that name is equal to. What we want is the level menu. There we go. Copy this back in the
character applied right here, set it in the condition
compile save. So if the current level has a main menu level than we
are not going to create. So if it's equal,
then it's false. If it's true. If it's true, then we are
going to know if it's false, then we are going to create the character your
eyes or compile save. And now when we play
the game, There you go. You can't see the health, but you can play
on your buttons. If we quit the game, the game, if we play the game, we start off and we
have the health, We can die, we can't move. We restart the game. We have the fading
in, We get it. We pick up jumps, we have the yellow
color, the doors open. Everything in our
game is perfect. Thank you so much for watching. Congratulations on making it
to the end of this section. Give yourself a pat on the
back and give me a good, nice, fat five-star review. A couple of nice
words because it helps me out a lot
and it keeps me going and let's you let me know or any other
platform you're watching this arm that this
is a course worth watching. Thank you so much. See
you in the next one.