[Music] hello everyone and welcome back to the course in this lesson we will be taking a look at our first class inside unreal engine we will get to see many of the things we learned in the previous lesson familiarize ourselves with a blueprint editor and create our first custom class let's get started we will begin by creating a brand new unreal engine 5 project so open the epic games launcher click on unreal engine on the left click on the library tab at the top and for unreal engine 5 go ahead and click launch once the
editor opens go ahead and click on the games category on the left click on third person we'll make sure that it has blueprint selected the desktop target platform maximum quality make sure you have starter content selected and give your project a name once you're ready click on create [Music] once unreal engine loads you'll be shown the third person template level as you can see on the viewport this template comes with a sample level and also a sample character class that's already been pre-configured for us as a starting point so let's go ahead and take a
look at that class now right here at the bottom on the content browser click on third person then right here click on blueprint and you can see right here double click on bp third person character feel free to grab it and dock the window so you can maximize it welcome to the blueprint editor this is the custom code editor included with unreal engine where we can create or modify all of our blueprint classes now at first glance it can be quite overwhelming so we'll be taking a look at the interface section by section let's first
focus on the middle here you can see that we have three different tabs the event graph the construction script and the viewport the event graph will be where you create most of your code that will run inside the game and as you can see here we already have some predefined nodes that control how the character moves once we're inside the level we'll be taking a look at the event graph in a future lesson then we have the construction script which is again another area we can add our own code this will also be looked at
in a future lesson and finally we have the viewport when you click here you'll see a visual representation of your blueprint this will give you a preview of what your blueprint looks like once you place it in the world now let's take a look at the top part of the interface on the right hand corner we have our parent class which in this case is the character class and all the way to the left on the toolbar we have our compile button every time we make a change to our blueprint code we need to compile
our blueprint remember compiling means that we will be converting our source code into machine code an unreal engine gives us a green check mark every time it checks that all of our code has compiled successfully meaning there are no errors in our code the save button here will basically save our asset every time you make any change you have the option of saving your changes to disk next we have the browse button this button simply takes us to the content browser and shows us exactly what our blueprint asset lives inside the content hierarchy next we
have the find button and if you click it you'll be taken to a search bar where you can search for anything within your blueprint on the left hand side we have the components window here in unreal engine each class is composed of one or more components a component is a class that provides specific data attributes or functionality you can add as many components as you want to a class by simply clicking drop down menu here components form a hierarchy inside your class common components include a visual representation such as a mesh or a skeletal mesh
collision volumes that can collide with other objects in the world a camera in case of a pawn or a character so the player can see in the game in a movement component that contains logic to allow your class to move in the world you can also create your own custom actor components where you add your own data attributes and functionality this is a great way to organize your code as you can simply add your custom component to any other class to add functionality so using components means more modular classes and a convenient way to organize
our code this takes us to the opposite side of the screen all the way to the right to the details panel this panel shows us all the available options or whatever component we have selected so clicking at the top level on the left [Music] will show us all the available options for the class however notice that as we click different components the options on the details panel will change to reflect our selection this is very powerful as it allows us to customize our components further and when we get to it later we will be able
to customize these values in our code finally let's take a look at the my blueprint section here in this section you can add data attributes in the form of variables in functionality in the form of functions and event dispatchers we will take a closer look at this section in a future lesson so now that we've learned about the blueprint editor let's go ahead and create our first class let's go back to a third person map here and let's create a new folder so we can keep all of our custom blueprint classes click on the content
folder and inside right click and select new folder we'll name this underscore course double-click on the folder and create another folder called blueprints double-click the folder to go inside and right here right click and select blueprint class [Music] notice the window that appears we are going to select from a list of parent classes meaning we are creating a child class of one of these classes here you can see the common classes here you can easily expand this list here and see all of the available pre-built classes for this example though let's create a simple actor
class so click actor and name your new asset bp underscore generic actor and double click it to open it you can see how the number of components is different from the character class a lot simpler for sure let's go ahead and add a simple point light component to our class [Music] now that we've added the component let's go ahead and compile our code and say now is a good time to talk about another important concept before we close the lesson the difference between a class definition and an instance of a class a class definition is
a class you define by creating a child class of one of unreal engine's classes such as actor or pawn the class definition lives inside the content browser and is a file saved with your project an instance of a class is an occurrence or copy of that class in the level if we drag the class definition from the content browser to the level we create a copy or instance of that class in the level we can have as many instances of the same class as we want in the level this is important to know as you
can further customize each instance of a class inside the level now let's see this in practice let's go ahead and create some instances of our new class let's go back to our third person map and right here in the content browser we're going to simply drag our blueprint definition into our map like so and now we have created an instance of our class and if we can zoom in we can see that we have a light which is illuminating our scene and we can simply continue to drag more copies or instances of our blueprint definition
we're going to do one more on this side and you can see that we have three different copies right here on the outliner you can see them all right here and unreal will give it an instance name so you can see actor actor 2 actor 3 and we can select them all by by doing control click you can see that we have all three blueprint instances selected now one thing that is important to know is that if we make any changes to our class definition it will propagate to all of our instances not only on
this level but on every level so if we go back to the generic actor blueprint select your point light let's go ahead and change the light color so right here on the properties click on the color here let's go ahead and give it let's say a red tint click ok now as always we need to compile and save and now if we go back to our map we notice that all instances have changed their color to red in a future lesson we're going to look at how we can customize each individual instance that we see
here so perhaps they have different light colors while still keeping the main properties in the class definition so let's do a quick recap for the lesson we learned about the blueprint editor the main graphs where we add our code the toolbar the components window the details panel and the my blueprint panel where we add data attributes and functionality we learned about class composition and how using actor components can keep our classes modular and our code organized we created our first custom class and we looked at the difference between a class definition and an instance of
class so if you want to practice what we learned go back to the third person character blueprint class and explore the available options for each of its components and that's all for this lesson thank you so much for watching and i'll see you in the next [Music] you