Unreal Engine 4 Blueprint Tutorial for BEGINNERS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm going to try to teach you the fundamentals of blueprints in unreal engine 4. it's a vast topic and it could take a thousand videos so i'm just going to try to keep things as basic as i can in this first video and this video is intended for people who have never done anything in blueprint so maybe you just watch my unreal engine for beginners tutorial and then now you want to learn about blueprint that's what this video is about so i'm in this third person project here and the first question you might have is what is blueprint it's not the easiest to describe one way to describe it is it's just a bunch of classes so if you right click here in the content browser you can create a basic blueprint class here these are all the different classes that unreal engine has if you click this drop down then you can see every single class that the engine has for you now when we select these classes and we make them in our project here they're considered blueprint classes because we're making them in the engine so for example if i wanted to make another character i would click this character right here and as you can see right here it says this character is a type of pawn well right above it here is pawn and then pawn says it's an actor so right above the pawn you see actor so what you're seeing is this inheritance where the actor is the most basic class and then you have a pawn which is a type of actor and then you have a character which is a type of pawn so the character actually builds off of the pawn which builds off of the actor now if you look down here in the all classes here this object class is actually the most basic class in the engine it says right here the direct base class for all unreal engine 4 objects so if you expand that then you see actor and this is basically like the second most basic class so when you're building games in unreal engine you're going to be using a lot of these actor blueprints right here as well as characters and occasionally you'll use pawn and player controller but actor and character are going to be your most common classes in my opinion so actor for example i just made it right here let's just call this a door right so an actor can be anything as i said it's a base class so i just call this a door so let's open up our door blueprint here and this is what you'll most likely be presented with this is just an empty actor let's just go left to right here so in the top left these are our components this is where we can add components so right here you get your common components so you can add like a cube for example and now right here is this compile button anytime you make changes to your blueprint class you're going to want to click compile and then you'll often click save right afterwards so one of the best tips i can give you is to save often compile and save all the time so let's say you added this cube here and now you want to put this blueprint into your level the way you would do this is you would click this magnifying glass that takes you right to your object here that you were in you can drag it into the level and drop it in and now we can move it around but there's really nothing special going on with it it's just a cube if you're going to make a blueprint class that basic you might as well just come over here type in cube and just add a cube in this way so if you're going to work with a blueprint class you should probably be doing more things than just adding a mesh into it so that's where this event graph comes into play and this is where you do programming so if you've never programmed before that's obviously a topic that could take 58 hours to explain so let's just try to keep things really basic high level and just i'll just give you some tips from my experience so number one i will say that learning how to debug and find problems is going to be the most important skill when it comes to blueprint and the reason for that is because even if you're good at blueprint and programming in general you're still going to run into issues and finding those problems is going to be the majority of your work but let's just keep things really simple so this begin play so this event begin play anything you do off of this is going to fire anytime a level loads and what i mean by that is when i click this play button and i start playing this is the beginning of the game assume the level just loaded and the player is now in it and moving around every single blueprint class that you have in your level anything that is running off of begin play in that specific class will fire so the very first node that you might want to learn here is called print string just type in print here and then you can get it i am a cube yes okay so i made some changes in the event graph here so i'm going to click compile and now in the top left corner when i play you're going to see that message i am a cube yes so that message got displayed because this beginplay node got fired so this is the most basic function or whatever you want to call it that you can ever do this is basically like hello world it's the very first function you ever learn when you program but let's expand this print string here when we expand this if you hover over these things this says string this says boolean this says a linear color structure and then this says float these are all values that we can actually manipulate and so a really handy trick here is you can actually right click these values and promote these to a variable so when i do this i get this new string variable because that's what this is right it's a string and i created a variable from it and on the left hand side over here it automatically added the variable so now i can either click this variable to rename it or i can press f2 and let's just call this our let's be a good programmer and say our beginning message right this is the very first message that's going to fire and so instead of typing it in the print string here we can now over here in the details panel this is where we would type it so now we can say my cube is stronger than yours we can compile and save and now when we play it's going to say that message so there you go and now the message only lasts for two seconds you can see it says two seconds right here obviously you could just type in ten but then that's not teaching you much about the basics of blueprint why don't we right click this and promote it to a variable and now we can call this the message time so now we get this variable over here it's a float let's compile first and now we can adjust the time of this message how long do we want it to last for well let's say we want it to last for like 20 seconds so i'm going to put 20 i'm gonna compile and now when i play this message is going to stay here for 20 seconds okay we're not going to watch it the whole time though so now we have two variables here we have a string variable which honestly you won't use often i never use these variables ever but floats you're going to use these all the time and then this right here print to string this is a boolean it's red so if you right click this let's make it a variable we'll call this print to string with a question mark and if you don't know what a boolean is it's basically a true or false well another nice tip here is if you hold down the alt key and click it disconnects it so what we're going to do is we're going to move this over to the beginning i'm going to drag off this i'm going to type in branch and now you get this branch node now these branch nodes you're going to use with your booleans all the time so you connect that up and now what we can say here is if this print to string is true let's do something over here let's do a print string for example we can say yes i am true and then maybe we want the color here to be like red right orange and now down here on the false we can do another print string we'll say no i'm not true because i suck make that one you know yellow or something so now we can just decide whether it's true or false so we can just check this as true and now we can play and so it says yes i'm true and now if we turn it off and play it says no i'm not true because i suck so this branch node and these booleans you're going to use booleans and branch nodes all the time during your gameplay logic maybe the player doesn't have enough stamina to sprint so you want to check that does the player have enough stamina to sprint if he does then sprint if he doesn't you can't sprint and a handy tip is to just hold down the b key click and you get a branch node put them all over the place you're going to use these all the time so remember that shortcut now i know i called this blueprint a door but we're not doing anything that's door worthy with it but if you do want to know how to make a door i do have a tutorial on that so you can just check the description and there's a link to it it is for multiplayer though so it's not the most beginner friendly tutorial as a beginner you really want to focus on just learning really like the shortcuts and what variables do things like that so over here you can always add a variable and then you can go over here to the variable type and you can select what you want your variable to be but most of the time when i make variables i'll either be making a boolean or i'll have a certain situation where i'll make variables off of the function like here for example i made the variable off of this string let's just do an example here let's say we wanted to spawn an actor right so you get this spawn actor from class so on begin play we want this door to spawn something it's asking for a class and what it's really asking for is a blueprint class so that means i might have to come over here and create a new blueprint class let's create a another actor just call this a ball right we'll keep it really simple and we'll just come up here and we'll add a sphere just going to compile it save it and close it and now back in our door blueprint here let's now just type in ball and there's ball this is the class that we just made so we're basically saying on begin play we want to spawn this ball and then this transform so what exactly is a transform so if you come into the level here any object you click you'll see this transform over here on the right so transform is the location rotation and scale so this character's transform for example has a location of x y z it has a rotation of zero zero zero and a scale of one one one that's a transform but with these transforms you can also right click and you can split it and maybe you just only wanna get the location or the rotation of the scale maybe you only want one of them right so that's what's really cool about the transform is you can split it but then you can also recombine it now there's a lot more to blueprint it's a very complex system it's not as beginner friendly as some would like you to think it is just it does take a lot of practice and repetition go through as many tutorials as you can take courses things like that just to get familiar so for example we were talking about transform here where do we want to spawn it and the reason why we can't compile is because it wants a transform here it's asking us where we want to spawn the ball let's select this reflection capture here let's say you want to spawn an actor at this exact location when the game starts all i really care about is the location i don't really care about the rotation it's zero zero zero i don't care about the scale it's one one one so what i can do here is i'm actually going to split this again and so zero zero zero for the rotation one one one for the scale that's good but for the location we want minus sixteen minus eighty five twelve so i can type in minus sixteen minus eighty five twelve now if i compile it says it's okay and now when i play there's a ball in the sky how cool is that now this character is a blueprint as well so this character comes with the third person project here so when you select it you can actually come over here in the world outliner and click edit third person character it actually opens up his blueprint class so now this is a very basic character you can't get any more basic than this so i encourage you to open it up and just try to understand what's going on here this is all just movement that's all this character does is just moves around so we have this move forward move right this mouse input is turn and look up and then this jump makes the character jump and now this function automatically comes with the character class epic has been nice enough to create this class in the engine but still this might seem very foreign to you if you're brand new so what exactly is this move forward this is called an input axis and to make this easier to explain i'm going to go up to edit and then project settings and then we have input on the left we have our axis mappings and our action mappings so an action mapping is more of an action like you press the mouse button and you fire a weapon or you press space and you jump right so if you click this arrow you can see it says spacebar so i'm going to add one and let's just do fire and i'm going to type in left mouse and you get left mouse button so it automatically saves and if i come back into the third person character here to add that new action mapping if i right click and then type in fire i now have this action event so this action event is what we just made here in the input so what this is saying is anytime i press the left mouse button it's going to do anything so let's just do our print string again let's make this red or orange whatever and you can just say fire so i compile and when i play every time i left click it's saying fire so now this is how you would set up some very basic shooting with the left mouse button you'd set up the input here and then every time the player presses the left mouse button you would fire a weapon but that's a topic for another day what i would recommend you do is if you're trying to set up a character you can just take this movement stuff here you can just copy it and select everything copy it and then i can come into door for example and paste it and that's what's really cool about blueprint you can just copy functions around and events and things like that and then you can also make your own events so for example we right click type in custom you get this add custom event let's click that and we'll say turn on physics for example and we're actually working with the door here so when i play the door just floats but with the door selected i can actually i can actually select the cube here and if i scroll down i can actually turn on physics like this and when i play the cube falls to the ground right but let's say we don't want to do it this way let's say you have a like a hundred cubes in your level or whatever you don't want to go through each cube and and manually turn this on so what we're going to do here is on begin play we're not going to spawn the ball so i'm just going to hold down alt and disconnect it we're going to turn on physics but we're going to turn on physics after three seconds we're going to wait three seconds and then turn on physics and make the cube fall to the floor so to do that here's another node that's going to be really common so you just type in delay you get this delay so this function is really common you're going to use it a lot let's say we want to delay for 3 seconds so we start the game beginplay fires it's going to hit this delay and after three seconds it's going to do whatever we tell it to do here so let's say we want to call this turn on physics event right here and drag off this type in turn on physics so now if i double click this takes us right to the event very handy shortcut to get to where you want to go so after three seconds it calls this function and anything we do here is now going to fire so let's select the cube up here i can hold down and drag it into the editor here and now if you have the cube selected most of these things on the right hand side over here in the details these are things that you can actually edit in the blueprint graph so for example i was turning on physics right well i could actually do that here i can drag off this and let's just type in simulate physics and you get set simulate physics and now we want to turn it on so with this cube you have to actually select up here i'm literally just turning this on through code now same with this gravity i could turn it off if i wanted to so i could drag off this and type in gravity and then we get set enable gravity and if i keep this unchecked we're actually setting it to false so it's true by default but if i connect this up and play this is actually going to turn off now but i don't want to do that i want to simulate physics so you can see it fall after three seconds so let's play and there it goes three seconds later cool now let's come to the viewport here we can also add other things up here i can add like a light for example let's drag it up here let's make the light the color or like a red and then out here you can actually see it's just red up there now so i'm just showing you you can add lights and stuff to blueprints and then again if i drag this light out here all of these values you see in the details panel i can edit these in the graph so i can go intensity and then you get set intensity so now i can change that number by default it's 5000 but i could set it to whatever i want now so that's really handy just when you add a component so just look over here on the right hand side see which things you might want to adjust most of the time you won't do things like that but there are situations where you'll want to simulate physics for example or maybe you'll want to turn off physics but this is just an example i'm just trying to help you get comfortable working in blueprint it's a complex system there's so much to it what you're going to want to do now going forward is just i would encourage you to check out my top down shooter video we're going to make a top down shooter in one and a half hours or something like that we use a lot of blueprint it's all blueprint and you'll also make some ai and shooting a weapon so that would be the next step that i would take if i were you just to dive into the engine and get familiar with blueprint and repetition is how you build the skill the more you work in blueprint and do things the more your brain's just gonna start remembering things and picking things up just like any other skill so that's gonna do for the video guys thanks for watching and if you're new hit that subscribe button and go check out my top down shooter and i will catch you on the other side
Info
Channel: Unreal Engine Tutorials
Views: 182,959
Rating: undefined out of 5
Keywords: Unreal engine 4 blueprints for beginners, Ue4 blueprints for beginners, Blueprints for beginners tutorial, Beginner blueprints tutorial unreal engine, Ue4 blueprint beginners tutorial
Id: Y1iWAxoSWLg
Channel Id: undefined
Length: 19min 42sec (1182 seconds)
Published: Tue Oct 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.