Unreal Engine 5 Basics - Structs, and how to use them!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] thank you [Music] hello everyone and welcome to a slightly different kind of video today today we're going to be looking at some beginner information on struts and how to use them uh what I've done here is I've created a struct as a demo for us to use which has just got a text and some integers as well as a nested struct which in itself is just for integers we've added that as a variable over here in my actor and what we're going to do is we're going to go to flick this switch make a change so we'll be able to see how we can make any changes in runtime first thing you need to know is that with a strut there's not the usual get or set options that you would normally do there is a set if you want to set the entire structures one thing but if you want to set just one or two impacts of it it's a different note entirely in order to get any information from a script you don't use get uh let me just grab a example so get stat one you can't drag off and go get set one you have to break it open and then you've got all the options there in the sort of mini variable list similar to what you have on the left hand side so what I'm going to do very quickly I'll be back in 30 seconds I'm going to create a Quick Print text that's going to print off all of this information okay I have just finishing this off now by plugging in all the information one thing to note is if you have a nested struct inside a strut you do need to break the brake in order to get the information there as well and there we go I've placed the actor in the world so now if we was to load up the world you'll see it should bring all the stats in together I've added some default settings to the variable making out 10 10 5 10 and one two three four so this is how you get any information from a struct so the question is then how do we change anything in a struct so the way you would normally expect it to work is you can use set demo structs but in order to do that you need to use a make node which is the opposite to a break node and if you want to change just the name for example you can change the name to Gary and bring all the all the nodes over and connect up this so if I add that to there and print off we'll see you can see they're not making any changes yet make at 10 10 5 10. and if I make this true now says Gary this is a very messy way of doing it so what we're going to do is we're going to remove these over to the side just so you can see what the other option is and we're going to grab demo struct we're going to go set members plug that in change the name Gary and play does exactly the same thing that way you can also change a stat to 32. the only way this gets messy is if we need to change anything in the nested variable here so instead of us doing this for example we do need to break the node we do need to uh grab the nodes from a break initially again set members and we can set that back in there so we set 3 to 55 and play and there you have it guys it's uh pretty much all the information needed for how to use struts if you like this different kind of short video by all means please leave a like And subscribe to the channel and I shall see you next time thank you very much
Info
Channel: Burrow Games
Views: 4,701
Rating: undefined out of 5
Keywords: Pong, Unreal Engine, UnrealEngine, Game Dev, Tutorial, Beginner Tutorial
Id: MQ2pBnkLmWI
Channel Id: undefined
Length: 5min 32sec (332 seconds)
Published: Sun Mar 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.