What Are Variables? - Beginners Informational Guide To Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] thank you hey everyone and welcome back to ue5 BP Guru in today's episode we're going to be starting um a new sort of Series where we look at beginner information now this isn't going to be creating a video game or creating any code but we'll be talking about a lot of the things you should expect to see and use when making your own video game we're going to be starting off at the very very beginning looking at variables um we're going to go through the 11 most important ones I think you should be using uh or at least consider using when you're creating your video games at some point or another um now if you're in my Discord you'll know someone called Mr Mr meerkat he's been helping uh me with the Pokemon code and he is currently setting up his own channel I will be adding his channel to the um featured section on my YouTube channel so go and check them out show them some love um he's going to be starting um a bit like me with the beginner information he's actually going to be starting beginner tutorials where he actually creates some very basic games a bit like pong Mario those sort of ideas he also has his Discord you can find that in my Discord um where you can sort of vote to see what he makes over the next sort of week or so so moving on we're going to start at the very beginning as I said and we're going to be talking about variables today now variables are um nodes where you can store single information whereas arrays are where you can store multiple pieces of information but we'll talk about arrays in the next episode or or two but today we're going to talk about single variables like um where we store some information something we want uh to know or our system to know um down the line now as I said I'm going to talk about the topmost 11 I think are useful if you have any others that you think are useful please put them in the comments I'd love to know what your thoughts are on this we have two different sections to a variable so if we pull off from our right side the where the variables are listed on the left side sorry where the variables listed you can do this and it'll come up with a get or a set now the get looks like this and the set is like this now the get is where you are getting that information so you plug this into something to receive retrieve this information from the variable and setting is where we could change that information the first one we're going to look at is Boolean now boolean's um useful because you might want to ask your system your code a question so for example are we sprinting are we crouching and we can use this to drive that and usually you would use that with a branch like so that's how we would use a Boolean and again like it says here true or false yes or no one or zero that's kind of the general idea of a Boolean so are we sprinting true then we would um change maybe affect our stamina if it's false then we would not affect our stamina for example so that's a Boolean we also have integers now these are whole numbers this is uh the system deals with like one two three four um for example you might have money value so let's say you had 100 money that would be value 100. and then you want to add another 100 you would add um a hundred for example you'd say 100 okay and you could do this as a plus for example so you could say integer so let's say we had 100 plus 100 that would then come out as 200. so they ultimately deal in whole numbers um let's move that out of the way we then have float now float is like the decimal version so you could have uh 4.25 you could have minus 3.6 or 1.0007 it's just allowing you to um create those fractional uh numbers and these would be good for things like health bars and thirst hunger stamina where you want a more precise value to be used that's where we get our flow and they work in exactly the same way as uh integer works as I say it's just adding in that decimal we have a name variable now you'd use this for uh naming something like let's say you had an object in the world and you want to call it an apple or you want to call it a sword or maybe you've got zombies or you have a character like an AI character you want to give it a name like Darren Jake that's what you would use your name variables for the string now you'll probably notice this from like things like print string these are like a sentence uh for example um a sentence in alphanumerical which obviously uses like letters and numbers to create um your sentence so like for example you might want it to come up on screen saying uh hello name how are you you'd use a string to get that value next we have a vector now this is a location a 3D location within the world so you've probably seen me use it in the Pokemon clone series um where we get the vector which is our location of our character at any one given time on the X Y and Z value front and you could use this to get that location or set that location or tell something to go to that location you would use a vector Rotator that's very similar to the location but it's dealing with your 360 rotation again you can you can manipulate it on an X Y and Z value but this is just telling you the rotation where your player is facing within the world or the object depending on what you're trying to accomplish that is what you would use to determine which way it's facing next we have the object reference now this is just a uh a reference to a um an object in the world or a blueprint you can use it to access another blueprint information you could use an object variable to store that uh within your code you have a transform node now that is the compilation of the vector the Rotator but it also includes a scale for example if I pull off from here and I say make we can make a relative transform or we can oh make a normal transform which again splits out that location rotation and scale in which we can plug in for example if we had a get of our Vector we could say that's the location we want and using the Rotator that is the rotation we want and you can change the scale as well if you would like to and transforms are very useful for storing all three of those values under one variable and just two little bonuses this brings us up to 11 we have a struct variable and an enum variable I will go into greater depths with these but a struct if you have a structure that stores multiple variables in one area so if I break this now I am using one of my ringmon game variables but you can store multiple variables within one location under this struct and then you can just change your variable typing on the left hand side by searching uh for what you need so for example this one for me is my item strap you can just search for it and set it to be that and then using that you can break it or make it you can make it as well to um change these values and it will update and store all under this one variable lastly we have the enum now this is normally a list of different items or list of names that you want to utilize it's a list essentially of things that you would May potentially need to call in this instance I've used my ringman's status here I have Frozen poisoned paralyzed burned confused and asleep and you can call those uh when you need them so from for me as an example I use my enum to set whether my creature is poison paralyzed burned um and then from there we can check that down the line using our get and do stuff like take away damage depending on what one of these steps you might skip a move things like that all of these to me are incredibly useful um hopefully this explanation this brief explanation has sort of helped you to understand what each of these are used for uh in the next episode we'll go into some of these in Greater depth and show some examples of why you would use them we'll look at arrays in the in the future we'll also look at things like um bpis what classes are um and all that sort of stuff if there's any other small beginner things you'd like to know as well leave it in the comments I will be happy to cover it this is all for anybody who's new to Unreal Engine and they really don't know where to begin or what things are and how they work I'd love to explain them to you uh in Greater depths but this is just as I say the top 11 variables that I think everyone should in theory know and potentially use within their video games thank you so much guys for watching uh don't forget to hit that subscribe button don't forget to leave a like and a comment with anything else you'd like to know and I'll see you in the next episode take care bye
Info
Channel: UE5 BP GURU
Views: 4,304
Rating: undefined out of 5
Keywords: unreal engine, tutorial, how to make a game, ue5, unreal engine 5, explanation, node, how to use a, how to use, blueprints, integer, string, test, testing, health, variable, variables, what are variables, boolean, float, value, values, vector, rotator, location, transform, name, object, Unreal Engine 5, UE5, Unreal 5, ue5 variables, ue5 variable types, ue5 console variables, ue5 global variables, ue5 bool, ue5 boolean, ue5 name vs string, ue5 transform vector, UE5 Vector, UE5 Integer, UE5 Float
Id: 6D38CWw7VgA
Channel Id: undefined
Length: 9min 41sec (581 seconds)
Published: Mon Feb 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.