Simple Building System in Unreal Engine 5 - #1: Build Preview

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial today I am going to show you on how to create a simple building system now I will probably be splitting these videos into separate ones as it probably will be a very long one so in this first tutorial I'm going to be showing you how to get started so it's gonna be a very easy to follow so let's begin alright so the first thing I want to do is right click and create a new blueprint class and what we are going to do is create an actor component as we will add it into our first person blueprint or whatever we'll need so I can name this bpc underscore build system let's open this up and the first thing that we are going to be doing is create the building Loop the one that will line Trace into the ground and will display our preview okay so we're going to do is right click and create a new custom event and this will be the um preview Loop so on here what we are going to be doing is a line Trace and let's create a line trades by channel so shoot an invisible Arrow from one point into the next one now from there we need to start and get our camera position so we're going to do is add the begin play that I just deleted and I'm going to do is cast to the first person character blueprint or whatever character blueprint you're using and then here you can say get owner and then from the component so get a Target component and then I'm gonna go ahead and just get the camera is the get first camera and then right click promote the survival and this will be the camera so now isn't a variable and I can use it whatever I want so now I can just get the camera over here and then say get world and then in this case will be the transform so I can just right click and split so the location will start here and the end point will be our rotation let's get it and let's get the forward Vector so we know at which direction we are looking at so now what we can do is time this by a value in this case and right click change this into float so we can put the distance as we watch the line Trace to end in this case personalized 700 we can play with that let's get a location and add it with this offset and now we can plug it into the end point let's put the debug type to be far duration so we can visualize this later on but uh there you go that will be a line three so now this will give us a output or two outputs so first of all let's make sure that we have hit something and then the second thing is they're gonna get the out hit make a break and now we can have all the details of where we have hit and and so on so what we're going to do right now is that if we have hit something we want to do a do once node and in this case we're going to do is also do a sequence so the first one will be the ones so here we're going to do is say add component by class okay in this case the target will be our player character so just right click and make this a variable so we like the player blueprint and we're going to attach it into the player basically so be the property of player there we go and now the class will be well static mesh and it'll be this type mesh component the normal one now we can put a transform in this case let's right click split it and we can put in our information there now I'm going to do is actually just controls it right click and promote this to available and this will be the uh build type build preview transform okay so we're gonna pass this as a variable right so in the sequence two gonna set the build preview transform and I'm gonna right click and split so in this case the location will be that location the rotation for now gonna lay like this and same with scale okay I'm gonna delete everything as default except the location so now that will be there and now what we want to do is right click and save this into variable and this will be the preview mesh I know how to type today what is happening there we go and now I can just get the preview mesh set World transform use this one and now we can plug in our transform over here the nice in a variable pretty cool and that will be it so now we need to do is make our keys so we'll activate it and so on so let's go into our first person folder input action screen new one right click board action EA will be filled and now we don't need even need to open it we just go into uh the default one just add a new mapping this will be built as a Nike let's say you beat or build so now here we're going to do is right click EA underscore build and I can toggle this build mode or not so in here we're going to do is call the preview Loop in the event tick so it's right click advantage and go the preview Loop I'm going to do is make a branch because we are only going to be doing this if of course you know we are in the build mode so let's right click on here variable and build mode and now I can spot this here and now here I'm going to make a flip flop on starter so the first time that will press it it will turn on build mode and the second time we'll go ahead and turn it off okay so now we can do that um so now you will see that if I go here and press B nothing will exactly happen is because we have to add it into the first person blueprint so let's go here and add the component DPC build system there you go and pal over here now press B you can see you have all these line traces and we can activate it or deactivate it of course there's no uh static mesh or whatsoever and that's because we of course have to fill it in so we can close the character go back into our and component as you can see there's no uh mesh right now setup in this case I'm gonna set a mesh okay it's going to be a bit temporal for now what I have is this uh Building Systems I got from my Marketplace asset and you can use it whatever you want we're going to be using this floor okay so you can go ahead and struggle here and now recipe you can see you have this floor I can drag it around and I can basically preview and of course uh that will be it okay so now let's quickly just create this material though we like transparent and so just right click create material and underscore it'll be the building uh preview open this up hold the three uh key left click and I'm gonna put this to be green over here and there's also select the outline you need to go and chances to be translucent so now I can hold one left click pass and a past value will be like 0.5 or even 0.7 you can play around with that but basically we have some Alpha and opacity so now we can do is basically afro here you can skip the preview mesh once again and then set lead material and now I can scope and put in my preview mesh let's twist it there we go and now you can see you can see now we have that preview over there let's also just go ahead and disable default duration because we will not need it and then also when we exit the build mode what I am going to do is get a preview mesh and set static mesh to be totally empty and then also I'm even gonna go ahead and get the Pu mesh and set it to be false so I'm gonna literally reset the variable and also gonna go and well if I'm not gonna delete the transform like this so now I can enable this and go here and then put it on or off you can see it doesn't appear once again and we have some errors because we're trying to get the world transformed but we stopped doing this um and this because also of the two ones it is not resetting so we had to reset this so let's just create a custom event and it'll be reset build mode and that will be there and then you're gonna reset the build node okay actually that will be yeah that will be here so now let me press play you can see we have this press B it's activated Press B activate Okay so we have all these toggles also in build mode Let's Make That by default is disabled very important so we won't start with the build mode so it's like this press B I enable it press B again disable it as you can see it will be able to start to choose where we want to place it in our scene so that's it guys if you found this so helpful or really appreciate if you liked the video and subscribe to my channel the profiles will be available in my patreon and YouTube members so check it out in the next few tutorials we'll be continuing with this build system also we need to disable equation and yeah with that said uh follow me on socials now yes blessed bye bye foreign [Music]
Info
Channel: Gorka Games
Views: 41,111
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5 building system, tutorial, quixel, megascans, unreal engine make building system tutorial ue5, ue5 build system, ue5 place build tutorial, how to make building in unreal
Id: -aKSc_hYBkE
Channel Id: undefined
Length: 9min 18sec (558 seconds)
Published: Sat Jul 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.