Beginner Blueprint node tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right understanding blueprints let's go through the different types of blueprints so these ones here they're all grayed out um uh are obviously the red ones so the red blueprints are events like this one is begin play so when the when the world when when you press play this this gets fired the whole world like appears and then this event is called like this one right here is event actor begin overlap that happens when one actor overlaps another actor and then event tick is every single frame the event tick will get fired and then you can have other ones too that are like Keys uh J key you can have like the J key so when the J key is pressed this pin will fire and then this pin will fire so that's pretty much the red the red ones oh yeah you can also make custom ones add custom event and then you can name it I and then compile and over here you'll see your inputs you can add you can add all sorts of variables so let's get into the next node type which is going to be your things like get player character so these are green nodes these are called blueprint p nodes um they don't have an execution pin these uh red ones are like the beginning of the execution pins basically what they do is get information for you but they also don't need an execution pin so usually you have to use these with another node like line line Trace by channel so something like this you know well we could just we could get get actor location and then get the target actor which can be the character and then and then uh we can feed this so these need these to work because like if you have this event begin play and you want to draw a line trace this will happen on begin play it'll read this way and then it calls this and then this in order to fill out the location it calls on this node and then this node calls on this node to fill out this this pin location there's two examples you can get scale get right Vector these all look pretty much the same but they do different things you know this gets your location this gets your scale this gets your right Vector you can get forward vector well you need to send a rot Rotator in there but yeah anyways these like get or manipulate information and then you have your blue your blue nodes which are like like I just had line Trace by Channel or set actor location or set actor transform so these blue ones uh make make changes in the world is basically how I how I think of it so these actually affect the world and then these are like helpers to then tell the Setters how to how to do things I guess I don't know I'd call these Setters well I grabbed all sets but the they don't all have to be Setters um yeah the blue ones basically make things happen the green ones help the blue ones make things happen the the red ones they they they tell things when to happen that's basically how I look at it all right and then here are a bunch of different variables so these are all like the most simple forms um you can we can see right here this is just this so you got Boolean bite so this one's a true false um these are all numbers they're pretty self-explanatory this one's a name String text uh Vector is a it's a variable with three different numbers so yeah these are your standard variables and then you have things like Floats or like an array so you can have so right here's a float and that's a singular float but when it has these boxes that's an array which is basically like a list of a bunch of different floats so you can have a bunch of different numbers in here and then it tells you the index index 0 1 2 3 4 5 6 you can populate this at runtime and grow it and shrink it it's it's a little bit complicated so those those are a little bit different but for the most part these are these are really simple these are just numbers and true false statements and strings and uh Rotator transform and these ones that are a little more complicated like these three are actually just like a bunch of these put together you can break them break and then you get the different versions and then these can be broke again and then flow is as low as it goes it doesn't get any you can't break it again yeah it doesn't it doesn't work but yeah so if you want to like know if there's anything in these you can keep breaking them and opening them up and you can see all of the information that they have so there are like structures that um are pretty complicated we could do something like that pull this out break and then you'll get all of the uh variables that are in there so a structure is just a group of variables so you can have you know many different variables in a structure and it's just one node that you have to deal with and then all these are tied to each other they're stuck with each other a way to get these is after you've made them over here you can just drag them out it'll give you the option you can either get the health so it'll get the value that's in that node or you can set it so you'll have the the get and the set like if you wanted to to remove Health you could do subtract a number 10 and then feed it into health and then I don't know we could just use like a begin play or something and now when the game like when you okay wait actually I got to set that variable so we'll set to health to 100 and then like when the game begins play what's GNA happen is this health Redway is going to have 100 but once this fires it's going to set which means this is going to call back to this node which is going to try to subtract health or 10 from health and it'll set it so instead of 100 it'll be 90 and then to see it we can do a print print string and then this is just like a little helper node that converts a double value to a string um and then when you play you get 90 so that that's if you can understand this you pretty much know how blueprints work so I think what we're going to do now is uh we're going to make a teleporter I think I think that's going to be pretty simple and easy to do I think I want like cylinder yeah let's go with that think make it a little shorter compile to make this work what we're going to do is we're going to delete that we're going to delete that we're going to delete everything um on our player first person character so this already comes with some blueprints in it but what we're going to do is we're going to to create a new event based on a button click and I think we're just going to go with with f so F key right there and now you get your two outputs pressed and released and then and then key I don't really mess with that that much so we know we're going to use this F key in order to teleport and we're going to create you can create your own Uh custom events add custom event and then teleport so this is a custom event that we made and we can call this from the player but there's going to be a problem so here we'll we'll try to teleport I don't think that's the right teleport right here teleport BP actor teleport so this is our BP actor and then teleport so if we try to call this well it it fails if you compile it's an error and it is you know this blueprint self is not a BP actor therefore Target must have a connection so you this this was like one of my biggest problems when I first started learning blueprints is okay how exactly do I know how what what to put into here this these blue ones like this they can take many different actors because you could you could have many different types of actors the blue one is just an actor reference it's it's not something super specific like the you know like a Boolean is red and the vector is is uh yellowish orangish you know this this is blue and kind of vague so what this actually is is you need to get an actual like representation of an actor in the world so if it exists you can get a reference to it but if it doesn't exist then well you couldn't even get a reference to it so that's what this is asking it's like does this exist where does it exist you know what what is this thing that you want me to call on um so there's a couple different there's many different ways that you can get a reference to this actor the one of the easiest ways if you just have it out in the world and there's only going to be like one of them or you you can you can do different things you can have multiple of them you could have like many different ones and you could just get like like the closest one but one of the easier ways to do it is you can just get all actors of class and we can switch the class to BP actor and because I know this is only going to be one we can just go get and then if you click this check mark it gives you things specific to the the blueprints a copy or to the array I should say um at index zero zero is actually like the first index they just start off with zero um and I know that this will work because we're getting all of the actors of a class but that's the only actor of that class and then I'm just getting that and then putting that into teleporter if you wanted to do many of them you could then like check check the distance to player or you could do many different things but uh this this should be good enough now if I compile that one away because we know that we're getting a reference to a BP actor because I found all of the BP actors in the game and made an array of them and then because I know there's only one I chose that one but this this is good enough for now so this we'll call this teleport um uh event and then what we can do is set actor location and then here's your your target again what which actor do you want to set the location of we want to get get player Pawn so this is telling this is telling this code in this function that we want to get the player Pawn we want that actor to move um and then our new location we can get get actor location get actor location I'll turn this on actor location and then we could just plug this in but there's going to be it's going to try to go to the center which is the center is like down at the bottom there and we don't want the player to be like half in the ground so we're going to go we're going to pick something up higher we're going to do an add uh this is XYZ Z we'll do like 50 no let's try like 80 okay so what this does now get actor location gets the location of this Factor so it's going to get its location and then we're going to add 80 to the Z and that's going to be the new location where we're going to set our player pawn and then we can tell it to to sweep to that location if we want or if we want it to just teleport I think if we just leave it alone it'll work just fine so this should be good enough code now that when I get in the game and press F it'll get the the BP actor um all of them and then it'll get the first one out of the array and then it'll call teleport and then this will call teleport and we'll teleport right on top of that so there way back over here press F teleported so if we uh alt drag so now we have two in the the world the new problem is now if you have two of them you need to know the difference between each one so you can differentiate based on distance you can check the distance to player for all of the actors in the array and then teleport to the closest one or the furthest one or you could make like a map and and like choose which one to go to or and so on and so forth yeah so now that we have two in here we're going to try we're going to try teleporting to it's probably going to be this one right here cuz this is the first one made and then that one will be the second one so it won't go to that one yeah we'll try teleporting now so yeah we go to this one not that one so that's kind of how the the blueprints work in Onre engine like or dislike comment subscribe bye
Info
Channel: Vahvuus
Views: 24
Rating: undefined out of 5
Keywords: blueprint, tutorial, unrealengine, Unreal Engine, UE5, nodes
Id: LORNj5hINdk
Channel Id: undefined
Length: 17min 0sec (1020 seconds)
Published: Fri Feb 09 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.