All Unreal Engine Nodes You Need To Know About

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video I will be going over all of the essential nodes that I think everyone should know when making a game in unal engine to get started I'm in the third person template and I'm also just going to go over to my content drawer to the third person folder and to the blueprint order and we're just going to create a blueprint example okay so let's get started if I just go over to my blueprint example and go over to the event graph this is where we write most of the code for how our blueprints will behave and one of the most essential notes is event begin play so the way this will work is as soon as our game starts it will fire this node so for our sphere event begin play we can just drag in our sphere then drag off here and look for set material and let's set it so it has this basic asset o1 material we can connect from event begin play into here and just go compile and if I close this and then drag my BP example somewhere into my level right now we can see it's this white sphere although if I play my game we can see it will turn to that basic 01 material so that's how the event begin play node works it's very simple next if we head back to our BP example and let's just go over how to use these other nodes so this event actor begin overlap so as the name implies when something overlaps this actor it's going to fire this node so if we just select our sphere we just want to scroll down and right now as Collision presets are set to block all Dynamic we just want to change this to be overlap all and make sure that generate overlap events is true and what we can do is if I hold the alt button on my keyboard and select here this will break the link here so this node will no longer work and if I just connect from event act to overlap into here and just go compile if I play my game right now it is white if say my player overlaps it then it will basically turn that color so when something overlaps this actor it will turn that color and then the final basic node we have is the event tick node so the way this will work is every single frame is going to fire this node so if I just drag off event tick and look for print string every single frame is going to fire this node so I just go compile close this and I go play on the left corner we can see it's print stringing hello every single frame so if you have a computer which is running at 60 frames per second every single frame is going to be printing that string next let's go over some variables and some essential nodes you'll use with them if we just open up the BP example and go over to the variables Tab and just go create new variable and just call this Boolean example and for the variable type make sure it's a Boolean just compile this now Boolean can be either true or false and if I just drag in my Boolean example get it and then just drag off here and look for branch and let's just connect this from event begin play into here and for the event active can overlap if I just hold alt to break the link here and I also break the link here and then if this is true I'm going to turn this material the basic asset o1 color and if this is false then I'm just going to do nothing so if I just compile this right now um this is empty so if I play my game it shouldn't change color and if I just check this and then I go um play it should change color and one more thing with variables we can make them instance editable and if I just compile this that allow me to dynamically um change the value of it in my game so if I just select this um blueprint and I press alt to quickly duplicate it right now if I go to default we can see that for this um blueprint the boan example is set to be true if I just just leave this unchecked and for this one if I leave it checked when I go play the checked one will change color and the unchecked one will not there are also a couple more nodes we can use with Boolean so right now we just have this um Branch node so if this is true then we change the color of this to be red but with booleans we can also use the and node so if I just drag off here and I look for and Boolean and I'm just going to create another variable and call this Boolean example 2 and I'm just going to drag this in here get it and connect it into here and connect this into here and I'll also make this instance editable and the way this will work is Boolean example and Boolean example 2 both have to be true and then it will change the color of this to be red so I just compile this and let's just make it true here so both of those variables have to be true in order for it to basically change color we can also use the or node so I just delete this I can drag off here and look for the or Boolean and I can connect from here into here and here into here so the way this will work is either one of these variables can be true and I'll change the color of this to be red and we also have the not Boolean nde so if I just drag off here and I look for not Boolean and connect this into here the way this will work is it'll do the opposite of this so if this is not true then it's basically going to make my material red however if this buildon is true then because this is not this is going to be false so it's not actually going to change the color of my blueprint we can just compile this and test this out so for this one let's make it checked so for this one if I leave it checked then it should remain white and for this one if I leave it unchecked then it should turn red so if I just go play we can see this one's white and this one's red so that's the boo variable and those are some of the most common nodes which are used with it the next common variable that you're probably going to use is going to be the integer variable so if I just create a new variable and I'm just going to call this number if we go over to variable type change this to be an integer then just go compile now an integer has to be a whole number so if I drag in this variable and try and set it if I try and make this something like 54.5 it's not going to work because integers need to be a whole number next let's go over some common nodes which are used with the integer so if I just drag in my number I can get it then if I just drag off here and look for the switch on int I'm just going to delete the booleans and Branch I made earlier and if I just add three pins then connect from event can play into here and from zero into here and I'm just going to copy this two more times so I'm just going to copy this and paste two more times I'll connect from one into here and from two into here and I'm going to change this to be the basic asset 2 and I'm going to change this one to be the basic asset 3 so depending on what number this is will depend on what color my sphere will change to let's make sure to make this instance editable so I can change it dynamically in the game and let's just go compile and let's just make it so this has number zero and this has number one and now if I go to play we can see they'll change to their relevant colors so like I said we can use integers to store whole numbers another common node which is used with integers is the random integer in range so it's good to use integers for creating RNG in your game so RNG is random number generator if you don't know that and if I just right click and I go random integer in range and I can make this go from a minimum value of zero to a max value of two and event plate is going to randomly select one of these three colors to be my sphere so if I just go compile and we go play it's just going to randomly um choose a color for our spares so that time they were both the same color although this time they're different colors the next variables and nodes I want to show you have to do with the vector variable for this example if we just open up the third person character and just create a new variable and call it location for the variable type change it to to be a vector and then find some free space and I'm just going to right click and make it so when I press the one key I will drag off here and look for the node set actor location and I'm going to set my access location to be whatever this location variable is so if I just drag it in get it and connect this into here when I press one I'll go to wherever this location is I'm just going to compile this and I'm just going to get the location of the sphere so it's 1,000 in the X 1,290 in the Y and 200 in the Z I'm just going to copy all of these values into this variable here and just go compile and I'm just going to delete this and now if I go play let's say I move away and then I press the one button it will transform me to that location we can also use the vector variable to basically change the scale of an object so if we just go back to our BP example I'm going to create a new variable and just call this scale and let's just change this to be a vector and I'm just going to press alt to break the link here and to event begin play I'm just going to drag in my sphere and drag up here and look for set scale and we want this one set wild scale 3D and connect from event begin play into here and then for my scale we can just drag it in get it and then connect it and now a good comp let's give this a scale of five in all its axes and now if I go compile and I play my game when I play my game we can see my sphere now has a scale of five in all its axes so those are some specific variables and nodes that you probably use together next we're going to go over some specific nodes that you may use if we just open up the BP example and we can just delete everything so far the first node I want to show you is the delay node so the way this will work is after the delay node has fired it's going to perform a certain action so we just drag off event play and look for delay and let's just make it 2 seconds so after a delay of 2 seconds it's going to now fire this completed node so after 2 seconds let's just make it say print string and let's make it say hello so I just compile this and I play my game after 2 seconds it'll print strink hello there's also another type of delay which is called the trigger board delay and I just want to showcase how this works so if I just go over to my third person character and we just want to look for event begin play so if I go crlf that allow me to search for specific noes and I'm just going to look for event begin and I want this one event begin play so here in my character it adds my player characters controls after we do this I'm just going to drag off here and look for a retriggerable delay and let's just make this two seconds I'm also just going to drag my one key and move it up here we can delete the set act to location node and connect from one into here and I'm just going to drag off here and look for print string so the way the retriable delay will work is if this is cooled again then it's going to stop it from firing so event play after 2 seconds it's going to print string hello however if I press one this is going to fire on the retriable delay and I'm going to have to wait another 2 seconds before this fires so if this retriable delay is co again it's going to reset it and we're going to have to wait another 2 2 seconds so if I go compile I close this and let's just delete the sphere and if I go play if I keep on tapping one then I'm going to be calling my retrial delay so it's not going to basically be able to print strink hello if I stop pressing one after 2 seconds it's going to print shrink hello so that's the way the retriable delay works the next node I think you should know about is the flip-flop node so if we just open up our third person character and I'm just going to delete this when I press the one key I'm going to drag off and look for the flip flop node so the way this will work is first it's going to do a then that's going to do B so when I call this flip-flop Noe first I'm going to drag in my mesh then drag off here and look for set material and connect a to here and let's just change it so our mesh will change to the basic one material and when I press the B button I'm just going to copy this we'll make it so our mesh will change to the basic two material so now I go compile close this and I go play inside of my um game when I press one I'll change red then when I press one again I'll change the other color and I can just press one and one to flipflop between those two noes one more thing since we're here we're using the set material node and right now we're changing element zero on our mesh if I just go to the vort and I my mesh right now this has two materials element zero is this one and element one is this one so if I go over to my event graph if I change the element index be one it's going to be changing this material instead of that material so now if I compile and I close this and I go play when I press one it's going to change element one on my mesh so that only basically applies if your mesh is using multiple material slots the next node I want to show you is is the sequence node if I just close this and we go over to our BP example we can just delete these nodes and event we can play it I'm going to drag off here and look for sequence so the way this will work is first it's going to fire this node then it's going to fire this node let's just add another pin and that basically allows us to add more pins to our sequence if you want to remove a pin from our sequence we can just right click and go remove execution pin so inide of our BP example first let's make it print string hello then we can change our sphere so if I draging my sphere I'll drag off here and look for set mesh and we want this one set static mesh and I can change the mesh of this to be something else so let's change it to be a cone and then I want to change this material so I can just drag off my sphere again and look for set material and I'm just going to change it to be basic asset 3 and I'll connect from here into here and now if I go compile when I play my game it's going to do all of those changes that happened a bit fast so what we can do is add our delay node so first we'll print Shinko and then I'm going to have a delay of 1 second then I'll change it to a cone and then let's have a delay of 2 seconds and then we'll change it to be um this color so let's go compile click close this and now we go play first it's a um sphere then it changed to be a cone then it changed to be green so that's how the sequence works the next node I want to cover is the do once node if we just open up our third person character and go over to the bit where we make it so when we press the one button it will change the color of our player character if we just drag off here and look for do once then compile if I close this and then go play when I press one to swap the color of my character if I try and press one again it's not going to happen I can only basically fire this node once so if I just go back to my third person character the do want will basically only allow me to file these nodes once what we can do is reset this do want so we can call it again so if I just right click and look for the 2 key I can make it so when I press two it will reset this du want then I can press the one key again so if I just go compile close this and I go play when I press one if I try and press one again I can't swap colors although if I press two there will reset the do want and then I can press one again so we can just use the do want if we only want certain event fire once and if we ever want to reset the do want we can plug some into the reset value the next node I want to go over is the branch node now we did already go over this when we set up the Boolean varable but I just want to go with a quick shortcut that you can use to quickly create branches if you hold the B button on your keyboard and just left click that allow you to quickly create a branch so just a quick recap the way the branch node will work is if the condition of this Branch works then it's going to fire off true if the condition of this branch is not met then it fire off false the next nodes I want to go over are event begin overlap and event end overlap if we just open up our BP example and I'm just going to go to the viewport and delete this sphere instead if we go over to components and go add and look for a box collision with it selected go over to details and in the search look for hidden in game and just make sure that this is unchecked just so that we can visually see this then if I scroll down and I go to on component begin overlap when something overlaps this this will fire so kind of similar to the node that we used at the start so let's make it so if our player character overlaps this this will basically basically print string so if I just drag off other actor element for equal and then if I just right click element for get player character connect this into here and then I'm just going to create a branch by holding BM my keyboard and left clicking if my player character overlaps this box we can make this print string player entered box and then if I select the Box again this time I can select on component end overlap and I can basically fire this um node when something leaves this box so we can just copy these nodes here and paste them again connect from other actor into here and from here into here so when my player character ends overlap with this box so they leave this box we can make this print string player left box let's compile this close this and test this out now normally in a game we wouldn't have the um box cision be visible but this is just for testing purposes that's why I made it so we can see it and when I enter this box we can see it says player entered box and when I leave this box it says player left box so that's how the begin and end overlap events work we also have the on hit event if I just open up my BP example and I st my box just change it CM presets to be block all so now my player is not going to basically be able to overlap this box before it on overlap all and when we have this set to block W I can go to on component hit and I can make it so when something hits this box it will fire this nerde so let's just make it print string hit and then we go compile and I play my game when the player hits this box it'll fire so that's how to use the on component so normally when I add a box cision these are the main three nodes that you'll probably use as a beginner next let's go over how to use the four Loop node if I just open up my third person character I'm just going to delete the nodes that we used last time and when I press the one button I'm going to drag off and look for the for Loop node so this will basically fire however many times my last index is so if I make this five when I call this for loop it's actually going to run this six times now the reason it's going to run this six times is because it counts zero as a number just to show you what I mean if I just drag off this Loop body and look for print string and then connect index into here if I compile close this and then go play when I press one we can see it print string six times because it includes zero as a number so 0 1 2 3 4 and 5 so the for Loop n will basically fire for how many times this last index is and when it finishes this completed node is going to fire so if I just drag off completed and look for print string and I can make this a completed then go compile and if I just go play and I press one it will do the for Loop and then when it's completed it will print string completed the next note I want to show you is the timeline we can basically use the timeline to make specific events happen over a specific duration of time let's go over how to use it if I just go back to my BP example I'm just going to delete all of the nodes I made last time and I'm also just going to go to my vort and delete this box next let's create a door so I'm just going to go add and look for a cube and I'm just going to go select and scale objects and just kind of scale up so it kind of looks like a door and then I'm also just going to go add and add another Cube and just call this the door hinge and just move this towards a bottom corner of your Cube so somewhere like here then just drag the cube into the door hinge now if I select the door hinge and let's say I go to select and rotate objects when I rotate the door hinge it should rotate my cube with it so this will kind of act like the hinge of the door so what we're going to do is using the timeline we can basically make this door hinge move so let's go over how we do that if I just go over to my event CRA I can just delete this branch and event begin play I'm just going to drag off here and look for add timeline we can just call this our timeline and if I open this up we can also select how long we want our timeline to be so I'm going to make my timeline 3 seconds next we just want to go add track and select add float track we can just call this our new track next we want to add some points to our timeline line so if I just right click and I go add key to curve flat one at time Z I want this timeline to have a value of zero then I'm just going to right click again and add another key to the curve float at time three so at the end of this timeline I want this timeline to have a value of one next we can just go back to our event graph so over the duration of 3 seconds we're going to make we're going to make our door open and rotate so if I just drag in my door hinge I just want to drag off here and look for set relative rotation I'm going right click on this new rotation value and go split stret up P if I just go back to my viewport and set my door hinge we're only going to be rotating our door in one axis and that axis is the z-axis so if I go back to my event graph we're not going to change our Do's values in its X or Y so if I just drag off here and I look for get relative rotation this will get the um rotation values that I have for my door and we just want to right click and go go split structure pin and connect X into X and Y into Y and from update into here so as my timeline is updating it's going to basically update these values next we normally use the timeline with the L node so if I just right click and I look for L and the way the SL mode will work is this can go from a value of 0 to one when the L is at a value of zero it's going to have value a and when this L is at a value of one is going to have value B so we just want to connect our new track into the alpha so our track goes from a value of 0 to 1 one way on our timeline at second Z this has a value of zero so it's going to be value a and when we in our timeline at second three this has a value of one so then it's going to go to Value B so if I just select my door hinge it starts off with a value of zero so here in a I'm just going to leave this at zero although I want my door to rotate to 90° so here in B I'm just going to put 90 and we just want to connect this return value into Z and connect update into here so as this is updating it's also going to update our door hinge it's also going to update the rotation of our door so I just go compile we can close this and test everything out instead of playing another way we can just test things inside of on engine is by going here and going simulate and this will basically simulate as if our game was playing so as you can see when I clicked play so so when I click simulate we can see my door slowly rotated nice so that's just an example of how we can use timelines to basically make things happen over time we could if we wanted to also just make an object become bigger over time so instead of setting the relative rotation of my daughter Bas ofate I can just delete all of these nodes and I can just drag up here and look for set scale and I'm just going to go for this one set world scale 3D and I'm going to connect from here into here and from update into here so right now my door hinge starts with a scale of one and let's make it so it scales all the way over to five and let's just go compile close this and I go simulate over the duration of 3 seconds we can see this will become a lot bigger hello the next node I want to go over are custom events so if I just go over to my third person character we can create custom event nodes so if I just right click into some free space and I look for add custom event and I can just call this swap colors and when I call this custom event is going to run it so when I call this I'm just going to drag in my mesh drag off here and off set material and let's make it so our mesh will change to be let's say this Arrow material then anywhere inside of my blueprint I can call this custom event so I'm just going to hold alt and break the link here when I press one I can call this custom event or maybe event begin play after I do all of this I can call this custom event another thing with custom events is we can make them have inputs so if I just select this I can go add input and I can make this customer event have a variable let's just make it have this boan variable and only if it's true we will swap colors and now if I go over to where I placed my custom event here I can see the input and I can just make sure it's checked when I press the one button and now if I were to test this out and compile when I play my game if I press one I will swap colors the next node I want to show you is the set timer by event if we just go back to our third person character I'm just going to delete this and when I press the one button I'm just going to drag off here and for set timer by event we just want to right click on this and promote it to a variable and just call it event example for this event we can just drag off here and look for add C custom event and I'll just call this swap colors flipflop for the time make it one and just make sure that this is looping so when I press the one button it's going to call this custom event and it's going to happen every 1 second because we check this looping box if I did not check this looping box then this would only happen once but make sure it's checked and make sure the time is one then when we call this event we can just drag off here and look for the Flip Flop and what I'm going to do is make My Player character swap between two colors so I'm just going to drag in the mesh drag off here and look for set material and let's change it so our M will change between this basic color and I'm just going to copy this and it will change between um this other basic color so I'll connect a into here and B into here so now I go compile and I close this so if I go play and I press the one button every 1 second it's going to run my um set Tim by event and it's going to basically make My Player character swap colors although we may want our set timer by event to stop running so let's go over how we can stop it if I just go back to my third person character if you remember we promoted this to a variable so if I just right click and I'll look for the two key again when my player presses this we can just drag in the event example get it then just drag off here and look for clear and validate timer by handle and this will stop my set timer by event from running so it'll basically stop it so I can just go compile close this and then go play when I press one it'll basically start my um timer then if I press two it will stop it so that's basically how we can use the set timer by event the next node I want to show you is the find look at rotation node this could be helpful if you want an actor to face your player character so let's just go over to our BP example and I'm just going to delete the door hinge and this Cube and I'm just going to go add and look for a cone and then another thing if I just go add and look for Arrow this will let me know the forward direction of my object just select your cone and rotate it so it's facing the arrow I'm just going to delete this Arrow now then if I go over to my event C and I'm just going to right click on for event tick and event tick I'm going to use the find look at rotation node to basically make this actor face my player character so if I just right click and up for find look at rotation we can use this node to basically make it face a certain object like our player character so this has two input start and Target where this is going to start we can just right click and for get actor location and the target this is where we want it to look at I want it to look at my player character so I can just right click and will get get player character then I can just drag off here and for get actor location then I can just drag off here and set actor rotation and connect this into here so event tick I'm going to basically be making my BP example face my player character let's compile this and test this out okay looks like I'm having a error in Target okay so that is to do with the thing that I deleted last time so I'm just going to delete this and go compile and I close this when I go play we can see the cone is facing me and as I kind of move away and around it it continues to face me and as I move up it will move up and as I move down it move down and if you wanted to you could make it so it only rotates towards the player in a specific axes so I just press alt to break this link I can right click here and split the Sher pin I can also right click here and split the structure pin and maybe I'll just make it face my player in the z-axis then go compile and it'll only face my play character in The zxs if I jump up it won't basically move with it okay so sometimes you just need to do that so so those are all of the essential notes that I think um you should know when you're starting un engine if you want to continue learning unal engine and want to learn how to create full games in unal engine make sure to check out my website unal engine University I have courses which will teach you how to make full games like a 2d platformer an FPS game a melee combat system and I'm always working on adding more courses so make sure to head over there and subscribe to access all of my courses there if you enjoyed this video make sure to like And subscribe it really helps me out and I'll see you guys in the next one bye
Info
Channel: Unreal University
Views: 49,831
Rating: undefined out of 5
Keywords: unreal engine 5, unreal engine, ue5, unreal engine nodes, nodes, ue5 nodes, all unreal engine, need to know unreal engine, unreal engine tutorial, ue5 tutorial
Id: KE_8OwmHY-A
Channel Id: undefined
Length: 32min 59sec (1979 seconds)
Published: Wed Feb 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.