Unreal Engine 5 for Architecture - 2023 Full Intermediate Course

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Impressive, but where does rhino come into the game?

👍︎︎ 2 👤︎︎ u/xarl_marks 📅︎︎ Jun 20 2023 🗫︎ replies
Captions
hello hello hello and welcome welcome to Unreal Engine 5 or architectural visualization intermediate level course what makes this intermediate is the architectural representation level and let me explain so at level 1 we have these static images you know a typical typical renders these still renders they show off your buildings and your environments clearly but the visual information is is quite limited and quite abstracted as well at level 2 we have animations like a roller coaster your kind of put on these rails and guided through the 3D space of the design a bit more information and especially if you animate the daylight cycle I've covered these two levels in Unreal Engine 5 for architecture beginner Edition course and we'll talk a little bit about that later so now after static and then Dynamic representation we have level three and that's Interactive you're free to move wherever you want in the design and interact with the environment right though I strongly believe that this is the direction in which the whole architecture industry is heading and I hope to give you a head start let's look at a short clip showing the end result of this course [Music] [Music] thank you [Music] [Music] foreign [Music] [Music] so a few things to note before we actually begin first you saw four key functionalities that we will be adding the first one being being able to move objects such as doors windows or what have you even chairs second one being able to switch materials are shuffled through materials per object basis third one being able to change the sunlight angle that's a very important one and fourth one being able to change the objects themselves and this should be enough for you to build upon and come up with your own ideas on how to develop your projects you know even even further and the second thing that I want to touch upon is that I will be using this scene that we have created during the beginner course you don't need the scene to be able to follow along but if you want it there is a patreon link in the video description below if you support the channel you will get the every model every scene every file that we do here for free now of course it does include this scene as well so with this being said I think we can jump right into it let's go for chapter one opening and closing of doors okay okay so the first thing that we want to do when creating this kind of interactive environment is make sure that our mode in which we're running this this project is set to well in our case first person character mode and to do so we can go to settings project settings right here maps and modes and choose or see if default game mode is set to first person game mode blueprint if not then there are a few things that we need to change let me quickly guide you through them well if your game mode is not first person character that means you probably don't have the assets and you don't you've started with a different type of a mode to begin with or a different type of a template to begin with so to add in this functionality you click on ADD choose add feature or content back and from here you choose first person and click on add to project once that is done you will then see these two folders appear or sorry three folders appear and also you will see under project settings you might need to restart by the way under maps and modes if you expand this and type in first person game mode you will see your yeah this game mode being available for you so that's that's step number one making sure that your uh game is running in first person uh you might need to restart it by the way for it to catch up for it to start working once you've done that then um when you press play the play button you will be able to run around in your environment and you can even see that the hand let's see if we can see it in the reflection yeah you can kindly see the hands and the reflections of your first person character the hands are the only things is the only thing that you uh that you get with the first person uh game mode but if even those will be deleted later on anyway that means this whole thing works now we need to introduce functionality right we want to open up a door and let's start with something simple we don't we will not open the door instead we will create a box here and we will rotate a box right so to do so uh first step is to actually create this kind of an interaction button right a button that you press to interact with objects for instance to open doors uh before I used to do this through settings through project settings creating a new key mapping but these days there's a new workflow right so to create a new in interact let's say button you go to your first person uh sorry you're you're your first person folder right here you go to input and here you can see there's IMC default State and IMC weapon state right so these are mapping contexts meaning that and basically they contain actions of what a character can do in different contexts so this is when a character is just running about the default State and this is when a character is holding a weapon meaning that there's going to be more actions available to the character characters such as shooting the weapon in our case we will not have a weapon here so we don't care we only care about this IMC default context so before I jump into here and actually create a button we need to create that action we need to actually have an action that will be able to be called by the IMC default context so I'll go to the actions folder here and here we have uh four different actions that the character can currently do it can jump it can look so switch the camera position it can move wasd right and it can shoot and that belongs to the of course to the weapon mapping context so we'll create one more right I will right click somewhere where is empty on the screen in the scene and I'll choose input input action click that and call it i a interact I a interact right so that's going to be an action where we press a button and my our character interacts with something in the environment I'll double click it just to check nope everything here is fine we we don't need to change anything here so we have that action let's go back to input and open up our IMC default uh input mapping context right like that so you can see here that by default the character is able to jump to move around and to look around right but it's not able to shoot because it does not have a gun right it does not it's not holding again and that's fine so for us I will add a mapping right here by clicking a plus sign which will open up this or add this whole tab I'll expand this and I'll find my I a interact input action like so and this is where you actually decide what button needs to be pressed to call for that action so you can either choose from from you know a bunch of a bunch of these menu I items or you can simply click on this keyboard icon and then press the button that you want to use so do we do mouse click no let's do the typical e button e as an eraser or Erasmus I'd e okay like that and with that done actually we don't need to do anything more we just hit save we close it and we're good to go so now our character has that interact functionality right which is great um we are not calling for it just yet because we need to access the character blueprint but at least we have set everything up now if I go to uh first person blueprints and I click on my first person character that is the character control blueprint right basically it has uh the viewport this is how how our character looks like hey it is what it is also I wonder why is this so weirdly weirdly placed capsule component component why is this offset ah whatever let's not worry about those things those are minuscule and easy to fix instead we go to our event graph right here right and here we will create that input action event right so when we press e button something happens because here you can also see event begin play When the game starts something happens and hence input action I a look around move and jump right so when jump is triggered jump character jumps when jump is completed stop jumping easy as that right so let's let me right click and choose i a uh or or sorry um interact right interact enhanced action event not value event interact like that there we go that's our button and we can do something very simple so when it's triggered we can print spring it says hello right let me compile and Save press the play button for some reason my character is outside now doesn't matter and just press e button and you can see as I press the E button hello is printed on the left hand side of the screen that means the character and I just Escape out of there that means the character does indeed uh interact with um sorry the interact action actually transfers to the character properly okay now for this to work we want to create a we want to know where the character is looking at and if the character is looking at a specific um like object and we press the E button it should shoot out array and if the array hits that object that object should then react to it right so imagine as we're shooting a laser at the different objects and if we're shooting a laser at a wooden box the first time you shoot a Blazer at it it changes color from brown to Black and next time you shoot it from black to white and so on right so you Shuffle the the colors or it rotates in our case it's going to rotate so when interact action is triggered we actually need to call for line Trace line phrase um and let me just see I believe it's just line Trace by Channel right like that which is going to basically shoot out a line until it hits something and we need to define the start position and the end position of the trace you know how long the line is where it starts or where it ends so the starting position is going to be quite easy because all we need to do is just get the camera first person camera from here drag and drop it in and we need to get its World position get world or World location sorry like that and that's going to be our start that's easy then for our end where it goes we need to basically understand what's the what's the direction of the camera where are we looking at so from this we will get forward vector get forward vector okay the forward Vector is actually uh very small it's one millimeter or one centimeter long uh and I believe maybe it's not going to well we'll see we'll see this might not work we might need to get the world Vector from the rotation information let's just try so get for Vector it's one centimeter long we need it longer than that so let's multiply and we don't multiply it by different numbers we're actually going to multiply or make the vector longer uniformly so I'm just going to right click on this input and choose to float or two integer let's choose two integer like full number and here I will just type in let's go for 10 centimeters 1 meter 10 meters yeah let's go for a thousand which is 10 meters right so now we have our forward Vector that actually starts from zero zero zero coordinates that's uh that we will need to fix that but ends at uh or its length is 10 meters 10 meters long so how do you move a vector to start from the head right from from the camera location well you just add up two vectors that's simple math so we just add our world location with our forward Vector like that drag that one out like so and I think that should do it let's save let's press play and let's press e oh yeah sorry Escape forgot one thing for us to actually see the line Trace we need to draw a debug type to change this to uh to be either for duration for one frame or persistent let's go for persistent right now so that it just stays compile save play now it starts inside that's weird um and let's just shoot out array see that's a raid that was shot I I just pressed e let me shoot out another one maybe here there's a ray that is being shot from from where I'm looking at and once it hits something it turns green I can do that again let's go for at the table a few more times and I can shoot a lot of them right I'm just pressing the I was just pressing the E button a lot right so we're tracing where we're looking and if I'm holding the E button it just keeps shooting which is not that great I I think we need to to fix that one because holding it should not trigger um the line Trace that much but it seems to work so that that's good um I believe maybe if we just choose started remember that's going to be fine oops sorry instead of triggered if we go for started or ongoing or completed sorry let's go for completed let's just see how that works press play hold the E button yeah so now it's going to shoot out only when you release the button which might be might be a better better result uh let's try the last one I promise last one and then we'll move on we've started yeah uh started is the best okay started basically triggers it once when you click the E key and it does not keep tracing multiple multiple line Traces by you just holding the E key either way now we have a working method of how to check what the character is looking at and what it's shooting at right so now we need like an interactive object somewhere here and if we are looking at that object the character or if the character looks at that object and we press the E button the object will rotate will spin how do you how do you do that well you go to your content uh folder the main content folder and you create a new folder in it call it blueprint or blueprints blueprints and here I will create one more folder and call it uh like Interactive interactive move interactive move double click there and we just create a new blueprint class and I'll make it actor and call it um test box test box should be fine double click and inside of the text box test box will add a cube just like that there we go you have ourselves a little a little Cube then this cube right here we will need to um let's thank every time you hit the cube it needs uh there needs to be something that triggers here how do you do that well actually you need one more one more blueprint let me compile the test box uh close it or not close it I'll just dock it in here and let me go to my main project and go back to blueprints folder and here I will just create a new blueprint but it's not going to be like a blueprint class rather under [Music] um I think it's under blueprints yes blueprint interface think of it as a bucket which gets filled with information if something happens so it's you use it to transfer information from one blueprint to the other and thus we will transfer the information from the our first person character blueprint into our test box and that information is going to be yo I just triggered you with the by by shooting at you right so we'll use blueprint interface like that I'll just call it BP interaction blueprint interaction and we don't need to do anything with it it just needs to exist right that's all blueprint interface then in our apologies in our test box we want to be able to call for that blueprint interaction asking yo do you uh do you have something for me right from this blueprint so how do you do that well you go to class settings right here and under implemented interfaces tab you click on ADD and you find your BP underscore interaction BP interaction like that you compile you save and if you were to look at where is it are we not calling for it maybe maybe it's fine so once you have it um implemented right you right click and you choose interaction let's take a look it's not being called what's going on that's weird compile and save save okay uh sorry uh so what what was weird is was that this was not compiled so you do need to open it up until at least once and by this I mean the BP interaction blueprint interface you need to open it up at least once compile it save it close it never look at it ever again and then once you implement the interface you will see under interfaces new function has has appeared if you don't like the name a new function you can always go back in here open up your interaction blueprint interaction blueprint interface and here under functions you can change the name so for instance I can just say interact interface interact interface like that compile save close and here you can see now in my test box blueprint the interact interface is you know the interface that we're using okay so now to actually have it in here in the event graph you right click and you choose interact interface um and it needs to be add event event interact interface like that and basically every time that that blueprint gets triggered blueprint interface gets triggered this interact interface will get triggered and then you can say yeah I just wrote it or in our case we will again use print string for now we'll just going to print hello from our box compile and Save go back to your first person character blueprint yeah and here when we hit let's say a box then we will need to um when we hit the box with array then then it needs to transfer the fact that the the box was hit hit them into the box through the interact blueprint right so to do so I'm just going to create a branch right here and I'm going to say uh if hit was done so if this returns true then something happens right then I I send the interact if it's false then I don't send anything right so that's the first thing then from here we can call I I let me check interact yeah we can call for interact interface as a message so we send it as a message that yo you're being triggered to the Box okay and now it asks me okay what where do you send this message who do you send this message message to and this is where our test box blueprint needs to go how do we know that we're hitting the test box blueprint well we can just get it from here from output of the hit results right so that's a structure meaning that we can break it break I'm writing break break hit result and let's just expand it like that and from it let's fish out hit actor this one right here hit actor and connect that to Target right so let me break this down to you you press e right here it shoots out a line from your eyes from your camera into anything that you're looking at or 10 meters straight right 10 meters it shoots out this Ray and whatever it hits it's trying to send a message to that you are being hit right and if it hits a box since the box has a message receiver the message receiver will trigger and it's the box is going to say hello to us right that's the plan so let's compile and save the character let's actually don't forget to put in the box right into your level like that let's press play ah why oh we have like a player start here that's why okay let me delete the player start and let's press play now there we go and we can just look at that box and if I press e it says hello to us says hello to us if I press e somewhere else it says nothing box says hello nice huh okay so that means uh this is triggering this is working okay that's not enough it not it needs to actually rotate right so I'm going to say um if we trigger this we play an animation of the Box rotating and to do so you use a timeline add timeline use a timeline that basically can have well let's call it box timeline misspelled it that's fine and you can double click on it to change its properties and we will so we open it up and here in our box timeline we add a track like that and we add float track okay and we can call this track box track no box animation track or whatever you want okay with that done we need to say specify here how long that animation is going to play so I'm going to say 1.5 seconds something like that then we need to add in two key points one at zero add you right click on the curve this line curve and add key right and here when you have the key selected you can just type in a time so add zero the value needs to be zero and then you can add another key it doesn't matter where you add it because here then you type in at time 1.5 the value needs to be 1 or 90 you I I prefer to always use values between 0 and 1 and then do the math layer outside in the event graph if you want to you can just use value of 90 degrees you know or whatever I'll use one like that you can press these two buttons uh Zoom to fit horizontal Zoom to fit vertical to fit vertical to see both points and then you can right click on them on these points and choose Auto so it's it basically will smooth the transition Auto as well it will smooth the transition of opening and closing right so it's going to slowly start then ramp up and then close uh slower okay let's compile or not compiles you can compile but let's go back to the event graph because this is this is good this is working and in the event graph what how do we how do you work with this well uh we need to add the rotation to our Cube so uh local transform and get local transform no add local transform to the cube just like that you can just add local rotation right second now I'm going to to find the best variant of this and then we'll teach you that one second okay I'm back so what we need to use is I believe I believe set relative rotation that's that's the best one so we can do set relative rotation and in this case we will use it for a cube later we'll we'll make it a little bit nicer but for now let's set relative rotation Cube like that so when it updates it goes into it it triggers the rotation and the new relative rotation needs to be uh broken apart so we can say make Rotator make rotator like that and basically here we just need to do this the side uh what's the new uh x y z rotation we don't mess with X we don't mess with Y but we will mess with Z of course right that that's that's because that's our uh the yard the door yawn and so on most of the things in architecture rotate about around that axis right so that that's what we're going to be using um we basically have that track that is going to be spitting out the info for us so all we need to do is and the info is going to be between zero and 90 uh no zero and one so we just need to take this and multiply that by 90 degrees right so we control uh the degrees through this number right here and that connects to Z yo be enough for us to yeah this should be enough for us to check if this is gonna work or not don't forget to compile and save and then press play like that press e yay rotates and next time I press e does not rotate any anymore right because it's constantly trying to set I mean it's it's setting it to 90 degrees rotation and it's not setting it back right so it's not going to keep on rotating or anything like that we need to actually be able to the next time I press it it needs to rotate back right so we open the door and then we close the door and to do so I'm just going to ask um how do we ask I I can ask if the door is open or not right so the door always starts closed right so I can I can do this under variables let's create a new variable and call it uh is door open right is door open that's a variable and it's a Boolean it's true or false yes the door is open Falls the door is closed right so we get is door open and actually here we can we can choose we can compile don't forget to compile and then is door open if this is not tick mark that means it's closed right so that's the default value that means we start with the door being closed and with this yes it is closed we can use a gate or a branch or gate wait I I keep forgetting branch is like that yeah we we use a branch right we use a branch where we say that if the door is not open if it's closed then it needs to open right so false goes into play right the door is not open it's false so you open it but if the door is opened if yes then you close it so it you play it the animation in reverse like that yeah something like this should be fine okay and now we need to check we need to change the the the doors not positioned but the state of the door from closed to open the moment we open it up right so every time when we get a box uh when we get box tracking I can ask yo are you greater than 0.1 or something like that like something very 0.01 it can actually be greater than zero if it's greater than zero if this number because we're playing it right if it's greater than zero then that means there's at least a little bit of rotation going on with the door meaning that it's not closed right so if it is greater than zero than this set needs to be [Music] closed right this this door uh yes it is greater than zero so is door open becomes um true right the door becomes open and we uh we actually need to evaluate this not every time we press the E button but at every tick of the game so I'm going to use this event tick you can create your own if you want to you know pick event tick right here uh but basically you just use that and you connect it to is door open so you check at every instance of the game and this should be enough for us to interact with any object in this case a cube but later a door okay let's take a gander let's take a look let's press play compile and save by the way and then press play e okay e rotates back e rotates forward E rotates back I shoot somewhere else does not react I should add it e e perfect works like a charm wonderful that's done now all we need to do is just replace the box with an actual geometry of the door and also instead of this ugly ass line Trace uh the the debugger we want to have like a proper like a nice little indication I still want to keep it minimal but I want it to be you know cozy nice and neat so what I did was I let me open up and show you I created this we hope that it's gonna open up properly um let me try here yeah there we go I created this paw image icon whatever have you and every time when we shoot add an object or anywhere it's going to put this cat pole on top of the object I think that's a good minimal interference type of a user user feedback or user interface of where you're actually shooting at so to import the Paw we actually go to materials because we already have our materials Tab and under textures I can just simply drag and drop it in and there's my image it does the same PNG that I showed you that it does not have a background and it's just a black image of a of a pole right then then I need to create a material so under materials I'll create a new one and that is going to be my uh Paul poor material right so basically we just create a new one uh material there we go and call it or decal or decal I still don't know how to how to pronounce that let's go for decal deco like that double click on it here perfect and here I basically want to the decal material I want to change a few things so the first one is the blending mode from opaque I will go for translucent or is it masked I don't remember I think it's translucent um and then here we don't really need to change anything else we don't change it to to no we don't we don't change this to decal or decal we keep it as a surface then for the base color we will use a texture sample texture sample for which we will choose our pore texture pull like that connect there we go then we have our opacity control uh right here where we can actually uh just use the alpha channel of our texture because it's a PNG it's transparent and just slap it into the opacity Channel and thus we get a paw I mean it's now being shown in a weird way let's show it on a cube and you can see there's there's our little paw right there there's not a lot of information here that we can use extra while we can have emissive color but let's not do that instead I believe maybe okay material domain let's not use a surface let's use a deco or deferred decal option right here because that gives us metallic and it gives us roughness and so on because I want to introduce a little bit of roughness I'll just hold um one on my keyboard and click wait one here stopped working okay cool I'll just type in scanner scalar parameter like that call it a roughness roughness and just connect that to my roughness input here and change its roughness to 0.5 so that's a little bit more a little bit more shiny you know a little bit more glossy easy as that and then for opacity I perhaps want the Little Foot here to be also a little bit transparent so I will remove from the alpha I will subtract let's go for 0.2 something like that here you can't really see that well maybe here you can see that it became a little bit more transparent you'll clearly see it once it's used in game okay that's done that's our material and we will shoot it at different surfaces every time we do a line Trace so now how do you okay with this then how do you actually shoot it out well um after in our first person character uh blueprint after we have um sent an information that yo we interact with you or whatever uh we can also create a decalordical at that location that exact location where we shot it so I'm just going to spawn decal at location the material is going to be our newly created Paul decal material decal material uh the size well I need to choose the size how big is a cat paw actually let's do it bigger right now just so that we can see it better but five centimeters it's probably smaller no it's probably bigger is it bigger or smaller where's my ruler No 5 is big for a cat well it is what it is uh we'll we'll have it five centimeters it's a large cut okay and then for location uh that's easy because we are hitting an object and we're getting a location where the object is being hit wonderful we just yank just connect location to location and then for our um the the uh rotation uh for now I will not uh change anything with the rotation because I still I I need to see if it's working or not so I'm just going to compile save press play and just shoot at the floor yay a bunch of cat paws are being created we're happy we are happy okay the problem okay actually let me show you the problem with it right now um well that's not a problem that that's fine it's just basically um yeah it works on the for instance the ceiling that works just fine it does not work properly properly on a wall so if I shoot on the wall you can see that it's just a blur and that's because it does not change its rotation according to the to the angle of the of the surface at which we are shooting right so we need to fix that so under our uh first person character under uh the rotation we need to actually um get a normal uh Vector right so normal Vector is like 90 degrees angle from the surface which we hit we need to create a rotation from X Vector like that so we create a rotation from X vector we um wait what if we just do that I think that that might work we get a rotation we put it in uh let's press play and just see okay so Paul is created there that's fine what about here hey and here yay okay so it does create pause a little problem is the fact that all of them are always rotated at the same angle that's boring that we don't want that so we want to create a little bit of Randomness right in terms of like placement of the Paw and to do so all you need to do is just this rotation we need to add up a little bit of Randomness to it right so we break Rotator uh is it into axis I think it's just brake rotator we get a roll the pitch and the yaw right so we don't mess with the pitch and the yaw we just mess with the roll right because that's that's this motion what I'm showing here that's the roll that's the pitch and if that's the pitch and that's the rule oh that's the yaw that's the yaw of course okay so we make rotator we connect pitch and yaw just as it is but for roll we will create a random random float random float and the random load it's basically a random number in between zero and one right so every time we press it gives us a new number so we just multiply it by 360 degrees foreign and then connect it to the X and that's our new rotation and this should work like a charm compile actually let's stop looking at the debug pipe or line trees debug so none we don't need to see it anymore compile save look at the building okay that's good what about here yep those are fits little cat feet okay so you can congratulations those of you who played Counter-Strike now are able to create it's praise in the map right but that's not what we want to do so we want the cat little cat feet to disappear after uh some time and that is very easy to do that's the lifespan right here so for the lifespan let's use something like a like two seconds something like that compile save try again poop there we go that works okay up okay so that's done that is done we are happy now it's time to finally finally make uh let's see this door open up right so to do so uh we need to uh well first of all let's save and let's close the material let's close the first person character blueprint we don't need that anymore um and let's let's close the test box blueprint as well let's go back in here to our blueprints interaction interactive move and let's just make a copy of our test box and that copy is going to hold the door uh so to do so right click duplicate call it door BP your blueprint and then open it up right so that's your your door blueprint let me make it smaller or bigger like that so that things fit and let's just delete let's just delete the cube from it just like that okay now the door blueprint is going to be uh kind of weird and that's because we will need to um how to explain this so stuff that comes from data Smith right from from the data Smith Library uh usually gets reoriented in a weird way uh so in this case for instance if I select the door you can see that it's three four eight minus three two nine and one one seven right and in terms of its alignment in the world and if you want like a perfectly precise alignment then you would need to work with these numbers I personally don't suggest you do that it's much better to fit it by the eye as close as possible and that's what we're going to be kind of doing honestly so basically what I'm what I'm saying is we're going to lose a little bit of this kind of perfect seamless connection uh to get get it going right to to make it a little bit more um user friendly or else it's going to be a lot of math a lot of numbers and we yeah we are not nerds we don't do that thing here do we okay so that door that we have here let me move myself to here like that so we we just select the object that we will want to root it and actually three objects because handles are also going to be a thing and I'm just going to click on this browse to be wrap three six whatever uh on my uh how is it called details tab in the details tab when I have the door slab selected like that and it gives me this B rep 326 perfect and I just under viewport I will just drag it in B rep 326 bam that's here now right let me just check one thing yeah okay that's fine so brap 326 is now now located right here and I can move it anywhere I want and then position it any any way I want but for now let's let's leave it be let's leave it at zero zero zero then we have our handle and the handle is going to be also we browse to it and we will not copy it we will move it in here right and that it can be connected to our to our door that's fine if you don't want it to be connected you can have it uh you can just drag it onto the default scene root and just attach it there it doesn't really matter where where it is right so now with this done um I basically need this handle to be placed in the you know kind of the same position as as the doors right and I can see that uh the door one seven and second 98 okay so the handle is placed like uh a mirror above the the ground level right and and here in this case the handle where is it it's at zero centimeters from from the ground level so all I need to do is just add 100 to it and this is going to be the correct height for the handle as for the door I kind of need to oh yeah I forgot that the handle is connected to the door so that's kind of stupid um so I actually need to first move the door up like that and only then will I get to to position the handle well it is what it is look like this you will be able to make adjustments as as you please later layer down the line right okay so I have the door and now back to the handle and the handle is at 100 and actually now I need it to be at zero and let's just with the move tool let's position it so that it's nicely placed something like that is it fine F2 zoom in um near near clipping set near clip plane the command uh sorry set near clip plane um like let's do one centimeter so one enter the set near clip plane command in the console enables you to zoom into objects much much closer and to to get much more precise alignment with things okay something like that should work seems good and I'm just going to make a duplicate of this handle so 28 there we go and I'll just uh I could just rotate it but I think we can just scale it by -1 ah it does that huh oh never mind sorry um if if we unlock the scale we can just scale it here by minus one and it gets mirrored to the opposite side and we just position it right here something like this okay then in terms of the materials we just kind of borrow the same materials um Oak veneer for the door Oak veneer and for the handles that's gonna be I guess like black metal or something scratched painted steel okay so I just holding shift or no never mind holding shift here I select both of the handles and here I just choose a metal black no not black scratched painted Steel there we go and we'll adjust as I said before we'll adjust the handles accordingly a little bit later down the line let's compile oh yeah a compilation will hurt and it's going to complain simply because the event graph the set relative location or rotation will not understand what is it that you're trying to rotate because it does not have anything to rotate so actually before we um let's delete that one the the delete the set relative rotation and we'll create a new one but then compile will work so before we can properly compile I need to create one last bit and that is going to be the hinge the hinge along which or around which the door rotates so under components I will add and I will add a where is it not box Collision not sphere Collision actor no not an actor a component okay let's quickly quickly find what we want to add maybe we can just add a scene so if I create a scene here like that and then just move it to where the hinge should be I should be able to simply rotate the whole thing because here for default scene root I don't want to to mess with that because that is going to be where my anchoring is going to be for the placement of the subject but the hinge of rotating that should be the scene right and then I just simply place it next to the door around where I want it to root it again if you want to have this super precise then you would need to do some math to to find where you know where these points are according to the thickness of the door and so on but in my case I don't really care so I'm just using the the values uh like by by eye right and once that is done I I simply just select all of my objects here and just drag them onto the scene right so now if I were to move my why is that oh yeah sorry and these need to go in here now now they messed up of course like that and then just place them back again here okay okay so a little bit janky but it is what it is but now we have our scene our hinge and if I were to rotate it 90 degrees it opens up and if I rotate it back it closes closes off right so that works we compile then we can go to event graph and actually create a movement or or set relative rotation to the scene to this guy right here because everything inside of it will follow right like that like that when it updates it sets don't forget that wire that's important and then the value is here compile save that just in case let's go into content blueprints slap and door I can already see that the um the handles are too high that's fine we will adjust it let's press play wait for the camera brightness to kick in there we go and then that opens and that closes great now we just need to put this door into this location but before we do so I will adjust the the the height of the handles how big it's like 20 centimeter or 10 centimeters right so under these both handles I just select them and their height seems to be multiple set to be at multiple different heights which is weird because I can swear that I said them um properly so let's set them to zero and then if I mess with it it just needs to go to minus 15 or something compile save look at it even more minus 18. save that's too much it was actually minus 17. okay and probably something like that okay now I will just simply delete actor is referenced by other actors and objects yes we do delete though yes and this one too and then we put in the the new door slowly carefully neatly think of it this way for for those of you who are like who are currently ocding uh think of it this way there is not a single thing in reality that has um maybe zero point five that that does not have a seam so everything has a seam right let's press play [Music] come on kick in Kick in there we go e welcome I don't fit why don't I fit I need to fix that that's fine though but the door does seem to seem to work quite quite well actually uh let me just check player Collision that seems fine actually so what about visibility Collision that's also fine okay so it's uh the problem is with the player with if you want to change the first person uh blueprints if you want to change the collisions of your character this in particular you just select the capsule and you just change the capsule radius from 55 to something a little bit more normal like 40. 40 means it's uh it's not 40 40 means it's 80 in in the diameter right so we press play we can e and now we should be able to oh we still can't get through because of the door let's try look at that open open okay so it's not like the Collision is not a problem it's just the yeah so the Collision is the the geometry is not a problem it's that the problem was the uh the character being too wide so I I just changed it like very thin thin boy 20. right in terms of the arms you don't probably need the the arms here so where where you have the first person mesh right here these These Arms you can just simply get rid of them delete compile save now your character will not have visible arms that you can see in the reflections right so that works okay so now we're done with creating a door right and I can actually now do this because I know that these doors are the same except for except for that door right there that door uh opens up to the other other side and I'll show you how you how you can quickly uh change you change up this blueprint to open to on the to have a hinge on the opposite side right so here I just position the doors really quickly um that's not good enough a little bit better come on holding down down the ALT key your key we are able to clone the blueprints or any object whatsoever holding down the ALT key and moving the objects you will you're you're able to clone them and this is actually I can talk about this as well I see how this is just black now and if I look around now the light kicks in again this is due to Lumen uh not liking the fact that all of this is a single mesh that has a lot of concave Corners so it's an unable to calculate the light properly which is fine uh we will not make this mistake anymore so if you want your files to be the best you have the best possible render quality then make sure that your lumen um not lemon sorry that your geometry is all split up into Labs into this kind of a separate entities that doesn't have nooks and crannies and does not Bend too much right so finite elements finite elements anyway so with this door right here that is opposite that is different I will just simply create blueprints interactive move and I'll just duplicate this door and I'll call it door BP uh opposite door BP opposite drop it in here right and all I need to do I believe is just inside of the blueprint change the scene to have a scale of um along the y-axis of negative one like that right because we're flipping it over right um and we just save do we need to compile we don't even need to compile or do we nope and then here we can delete this door all together come on select this one move it in place like that just make sure that everything kind of fits nicely yeah I think I think that's good yeah that that should be good okay uh we're done uh now we can save and test it out there come on kick in light light light light light light light okay and then that um opens up to the wrong side it is what it is if you wanted to open up actually it does need to open up outwards right because here we have the whole uh the whole cabinet or not cabinet like like wardrobe so it does need to open up outwards so that actually actually works for us okay that that lumen in that corner really does not like us but every other Corner Lumen kind of works quite kind of works quite nicely let's check out this [Music] yep that that that corner of the house is a no-go anyway uh that's us uh done with the the doors we can now move on and and by the way in terms of this you can use this exact like variations of this for Windows for desks that are folding for any sort of thing so it's a multiple multiple multiple things that you can do with it and it's up to you to decide which ones you want okay let's move on to the next one which is going to be switching of the materials so chapter chapter 2 switching off materials alright so in terms of the material control uh it's going to be pretty damn simple because we already already have created our whole user interface when we start playing the game we already are line tracing are capable of line tracing and making sure that um the character is able to interact with different objects right so actually creating a material change is going to be easy peasy so under blueprints let's create a new blueprint or new folder first of all new folder and call it interactive materials like that and inside of it let's create a blueprint class actor and just call it for now let's work on the floor right so floor BP floor blueprint there we go so our floral blueprint will have this B rep 513 in it okay so under lower BP actually we can close the door blueprint first person character blueprint and another door blueprint under here we can just simply add the parquet what's called we can add the brap 513 which is our floor uh geometry right so I will just simply select it click on this browse to be rep 513 uh it shows it to me in the content browser I drag it over to my default scene root and here it is so with things that we create in CAD software and import them through the data Smith plugin um the positions of things are usually anchored to two things first one is the geometry itself so B rep 513 has x y and z location and also there is the base model the starting so the whole scene that you import the whole data Smith scene also has its own location but in this case the base model in our scene is at zero zero zero which is very very good so all we need to do to know for a fact that this uh blueprint is going to be placed correctly is take brap 513 so our floor geometry selected and copy the x y z location into our blueprints B rep 513 so location X Ctrl C to location X Ctrl V location y to location Y and Z is zero so we're happy with that so now um once we create this blueprint or once we drag the blueprint into the scene as long as we as the blueprint's position is set to zero zero zero it's going to be the floor is going to be located sorry um on here if you want it to be even more um flexible then I can show you you can just simply anchor it to this base model actor right here and then if you move the whole scene the floor will follow along perfectly fine okay also uh I want the material for it so it's going to be Chevron tiles there we go or parquet Chevron parquet uh click save and for now I can actually dock it here all right so now with this uh floor still selected I'll just delete it hit delete not in here by the way don't delete it in the content browser deleted only in the in the viewport delete yes and now we don't have anything here oh that's the bottom of the floor yeah so we don't have anything here uh then under blueprints interactive materials we have our floor blueprint I just drag it in just like so I zero it out so the location is zero zero zero and you can see it fits perfectly right so that's that's what we're dealing with here and then if you want to for it if you change the base model position and you want your floor blueprint to follow along the base model uh you wouldn't just need to drag it um why can't I drag it one second make it smaller and then drag it yeah and then I can drag our my floor blueprint into the base model um so that if then I move my base model around you can see that the floor is moving with it right I will not be doing that though let's go back to lit preview okay so that that was easy right that that was easy so now this is a blueprint instead of static geometry meaning that we can mess with it right so back in in the blueprint under event graph I can just simply set material of brap 513 which is my floor like that and I can say uh that every time actually let's delete these three events we don't need them every time I interact with the floor you know every time I press e looking at the floor it should change its material easy as that right or you could have a dedicated key for it but for that you would need a few more actions which is ah whatever uh so instead we just use this so set material needs to be triggered by uh interact event right if you don't understand what I mean I suggest watching chapter one because we created the whole damn system in there that's why chapter one is so long and this one is gonna be so short so under class settings under implemented interfaces I add and I find my interaction interface BP interaction there we go compile uh maybe safe I don't remember but just in case compile save right click and then you just can call for interact interface and not function but rather event interact interface there we go and then we just connect it like so to set material and we can choose a material that is um funky let's find the funky material for us to work with [Music] um so under Mega scans surfaces can I have something yeah let's go for brass why not so brass and I just drag it over here to set material you can also search for it here if you want to but I just drag it and drag it over okay we compile we save and it's time to play to see minimize that of course so again doors are able to be opened up and what about the floor bam now it's brass cool huh and we can't can't switch it back unfortunately so to switch it back we need to uh introduce more functionality um back in our blueprint back in our blueprint I can just say that we will be shuffling through multiple materials by using gate multi-gate multi-gate like that I will say that it's going to be looped and every time we trigger and interact it's going to spit out through a different wire so output 0 first time output one second time ad pin output to third time and so on and then I just copy and paste set material for every time right like that and say that okay so my base material is brass and then my next material is going to be let's find a nice one is there like a nice one I don't want to take away too long or take too long travertine marble sure let's go for marble Maybe is there like a nicer one though yeah fine fine uh let's do marble uh so this is gonna be marble and or seashell is Bish marble that's a little bit better marble and this one is going to be the back to our Chevron Chevron Walnut okay compile save since it's looped it's going to keep on going through these let's press play nice neat and white poop and we just keep going right cool that works all right with this done I think we can I mean I I can show you one more we we can work on furniture I guess to to be able to change the furniture uh I'll just repeat it real quick just to show you that it's uh it can be done or do we want to do Furniture it's all the same maybe stay away from the furniture instead Let's do let's do this Niche right here with two objects rather than one yeah that that's gonna be good so back in where we have our blueprints materials let's just duplicate the floor and call it niche BP because that's the niche uh open it up and let's just like that and for the niche blueprint let's just find the geometries that we need to use so that's gonna be B rep one one two six uh that didn't drag over oh yeah it won't because we need to browse to it and then fish it out from this menu and then drag it over okay and then the bottom one the bottom little box here that's going to be Extrusion 106. and move it in here so and and then 513 which is our floor is unnecessary right so we we delete it and both of these have a material of travertine marble at a start so I just use that right for both of them just like so don't forget never forget the placement the the placement of these geometries right so what you want is for the Extrusion you want x y z to match up with that already existing coordinates of the objects in the scene or else things will be misaligned and bad and you will have a bad time trying to figure out what the hell is going on um and also for brap one one two six [Music] there we go now it's all neat and dandy compile does not compile while the synthetic compile that's because under event graph we have deleted the floor so it does not have a Target how do we make it have a Target again well we just take the two extrusions and Extrusion and B rep with the shift key and just drag it drag them over here and just connect B rep B rep Extrusion Extrusion Extrusion look at that so both of them connect to all three set materials right you can do you can set for separate objects at separate materials if you want to um I can show you for instance here let's say let's disconnect from the last one and the last one B rep will have the Chevron tiles or or material number three while Extrusion we do another set material like that and the Extrusion will actually let's make it cleaner like that so B rep will have one type of material while this one will have like steel or something brushed steel sure right so that's how you make them separate and I believe uh the second one or let's do the fourth one should be still the travertine marble of course right so we again set material doesn't matter to which because I will just grab the other one and connect that as well and that's gonna be travel time like that yep should be good compile save close uh and actually replace the existing geometry so delete delete blueprints materials niche and we just zero it out like that and when we zero out the position of the niche that of course automatically just slaps in place snaps snaps in place just like that we're happy with this we press play e e and you can see that this one is different like two different materials are attached so for instance for the share that will be exactly the same procedure you would have one material for the leather and the second material for all of the wooden pieces right there we go slowly making Everything Gold all right so with this done we can now move on to transforming the objects right to making the objects um different so for instance what what what's a good example what are we going to be working on like a banana or something right making making the banana work um yeah let's go for uh for a transforming a banana into into something else so that's gonna be the next one alrighty then so let's change up some objects so in terms of changing the objects or changing the materials that the workflow is very very similar all you need to do is replace an existing object with a blueprint or with that object and then instead of set setting the material you set the static mesh let's do that so let me just create a new folder in our blueprints folder call it Interactive objects and there's going to be a little bit more to it so don't don't just skip ahead listen up um so under interactive objects I'm just going to create a new blueprint class actor and call it um I don't know a humeral object or object BP object BP let's call it that here under oops here under object blueprint that we need to add a few at least one static mesh object right so I'm going to say let's right click here or sorry let's click on ADD and choose static mesh static mesh right so this static mesh right here is going to be the mesh that's going to change over like every time we press it but it does need the starting condition so our starting static mesh is going to be a banana banana just like that then we go to our event graph and under our events we need to say that we will be using the interact blueprint again as per usual class settings implemented interfaces if you have no idea what I'm doing then go to previous chapters because I explain it there add and then interact BP interaction there we go compile save and now we are going to be able to to call for interact uh event interact interface there we go so once once we call for it we want our banana to to switch to something else right so we can set static mesh right Set static mesh with this static mesh being the Target right and our new mesh can be well let's find one I believe I have downloaded from the quixel bridge I have downloaded this blue and red book so we'll switch a banana into a book uh let's go to not surfaces 3D assets and find how that book is called there we go or you can just simply drag and drop it in once you found it in the content browser like that so now if we trigger the banana it's going to change into a book let's see if that works or not compile save let's dock it in there close the floor blueprint and here next to this banana let's actually use our interactive banana like that and have it let's have it float like so press play read them wait for it to wait for the light to kick in and we have the floaty boy and we just we keep missing the floaty boy and it doesn't work okay so the reason why it doesn't work is because it has no Collision so if I were to check uh the the visibility Collision no that works uh player Collision it has no Collision so the ray does not trigger right so player Collision doesn't work on this so to actually have the Collision work for the banana we need to navigate to it double click on it right so it opens up the static mesh for us or static mesh options for us oh it's not even nanite so let's make it nanite enable nanite support here apply that's good and then we need to actually create where's the material there we go and we actually need to create a collision for it so remember when we used complex Collision as simple uh for all of the objects in the beginner level course in this case we will not be using that in this case we will be going into Collision here and we will add a I guess a box we can do a box simplified Collision for the banana right or capsule yeah probably a capsule right and what it's going to do is just going to add a little capsule around our banana so when it's bouncing around it's basically bouncing like this capsule is the one that's that's bouncing uh that's it once that is done we hit save we close and we have our banana with the Collision now so let's play again for this to kick in and then take a look at the banana and there's our foot this one doesn't change and this one becomes a book right uh we do need to do the same thing with the book or actually with any object that we want to use so with the book that's going to be pretty simple as well because our book well enable nanite support apply changes blah blah blah then go to Collision and a book is basically a box so we add box simplified Collision hit save hit close now our book works as well and last one I'll show do we have anything like a little bit more difficult [Music] okay I'll show it with a bang the bun does not have anything very fancy in terms of geometry we could just use a sphere Collision for the bun but I instead I will just show you because I want to that night support and I will just show you the convex Collision auto convex Collision and just hit apply right here as well in the bottom right so I believe yeah it should now have Collision around it and we will just see if that that works or not uh by just testing but uh basically the auto convex Collision it should also show up here yeah it does there we go that the whole thing is showing that's great um it basically will show you the yeah there we go it's going to show you the or going to create sorry a simplified mesh around your shape that is going to approximate the size of the mesh which is very nice it it does it very well as you can clearly see if you want to see the complex collisions you can choose under show simple collision and complex Collision both of them to be enabled save close now we have book a banana and a button right three of those apologies so pour the book um we we already have this set for the banana or for for the bun and then the banana we need to set it up once again so we will use multigate it's gonna be a repetition of what we did it's looked of what we did during the material uh shuffling mode this is initially the same the same process only that we're shuffling the the geometry rather than the material like that last last one is going to be banana second one is going to be book there we go compile save press play book wait why is the bun did I mess up oh yeah that's it's a book again bun my bad I'm sorry let's try again so I had the banana book book banana rather than banana book bun banana banana book bun banana awesome the problem right now is that they are not falling down I want them to be falling down right the physics needs to work so to make physics work all we need to do is click on the static mesh and here under simulate physics we tick mark simulate physics that's it compile save press play there it's it's rolling the banana is rolling and then we make it into a book and book is not rolling bun is not rolling banana is not rolling right in the works in some cases you you want it to not just be placed but also to to reset the rotation as well as position values so when we trigger the object blueprint when we trigger the change event or what we could do is um local offset add actor or add local offset to the static mesh and for Delta location on the z-axis we can just say 10 centimeters so we lift the object up by 10 centimeters every time we we change it and second thing that we can do is set um relative transform set relative transform to the uh not transform sorry set relative rotation my bad set relative rotation to the the static mesh right yes to the static mesh and the rotation we basically are saying that yo you you need to be zero zero zero right all all the time so every time we change from a banana into a book the book is going to be not weirdly rotated as banana was but rather is going to spawn perfectly horizontal that's that's what we want save um let's have it just oops that's the wrong banana that's the correct banana this is just have it somewhere on the floor or maybe at the table let's have it on the table why not come on go in here there we go throw down the banana something like that maybe even rotate it a little bit and let's press play let's just see what happens so here's our banana kinda awkwardly oh actually no that one is even worse this one is on there just fine and you can see every time I press the object falls from higher higher up right so that's that's quite quite useful uh one last thing is you can enable teleportation rather than movement so if your object is quite heavy um the the movement up will not affect the motion of the object right so teleport here teleport here for local offset and relative rotation and I believe that is that I believe that's it we have ourselves an object that can transform into any other object right so I'm using it this example with a freaking banana but of course you can use this with a chair right or use this with a sofa to change it into a different type of a sofa or coffee table or whatever have you right so that's that great last part is going to be Sun control so let's jump right into that in terms of some control the first thing that you need to do is to create an interface right so we want a slider here in the bottom to control the horizontal movement of the Sun and we want a slider here in the top or on the right hand side to control the vertical movement of the Sun so to do so we go into blueprints as per usual and I'll just create um in this case a widget let's call the widget a user interface thing right so under user interface we choose widget oh you can see widget blueprint there we go so I'll select that that's the only one that I can select click it and I'll call it UI widget I could also do a small little underscore there there we go we double click it and we start editing basically what is it that we want to have in here so the first thing that you always add or at least for me the way I work as I always add this uh what is hello where are you canvas panel canvas panel is a designer friendly panel that allows widgets to be laid out in any location I like the freedom that this um gives me if I just uh straight up just drag it onto my UI widget right here and this panel this is created great so with this done I will add two sliders slider one into canvas panel slider two into canvas panel or onto canvas panel and I'll call one slider um F2 select the slider and press f2 and I'll call it um h slider H4 horizontal and another one F2 I'll call it V slider for vertical right and my H slider I want it here in the bottom so I select it and here under anchors I choose bottom middle anchor right here like so right bottom middle anchor so now my horizontal slider is placed there if I I will choose zero to zero out the position of it zero zero and now you can see it's it lives right here okay let's let's fix a few things first of all I want it to be actually in the screen on the screen rather than below the screen so if I select it and choose alignment of it to be vertically set to I believe one then it gets pushed onto the screen that's great and then for the the horizontal alignment I will just do 0.5 so that it's right in the middle then in terms of my size X or size y uh my size X I will choose the width of it and it's going to be a thousand pixels wide right so I anticipate that the screen on which this is going to be played will be it will have at least a thousand pixel pixels in with I hope so um and then for position y I think I will just add like 20 oh sorry minus 20. just to get a little bit of an offset from the bottom right so same thing with the vertical slider first of all I will change its orientation to be vertical then I will change the anchoring of it to be actually always filling the right hand side so it's going to be this little option right here like so I will um zero out the position X like so and for the alignment I will say I believe it's 0.5 here no one second I'm I'm thinking it's weird it should fill here oh that's because the offset is so large so the offset from bottom needs to be zero now it's filling and now you can see that the size yeah so that's that's the X size the thickness of it and then our alignment that's 0.5 it's weird second yeah so that one needs to be one like that just like that okay and now I need to figure out why is it okay that's the bottom offset and that's the top offset whoa so for both I will use a hundred a hundred pixels to offset from the top and offset from the bottom and this seems to be fine this seems to be okay of a of a slider right one thing that I kind of want to fix is the um where the sliders are because they start at zero I don't want it so my minimum value for each slider needs to be -1 maximum one and the current value zero so they're going to be nicely oriented that way again a minimum value minus one maximum value one since the value is zero the right and the middle neatly neatly packed okay so this is like a again I I try for it to be as minimal as possible so this is the minimal user interface that we're all about right then here in the top right I press the graph where I actually have these two sliders and I can see what happens when they change when when they change when you change their uh values right so for each slider actually I'll get both of them in and you don't drag them in you just select them here under variables each slider and you choose an event that is called on value changed right so if you change the value of the H slider then something needs to happen and in this case we'll just go going to go for a print string right as per usual it's going to say hello to us when we change its value right we compile we save we close for now so that's our Widget the problem with the apologies the problem with the widget is that if I now press play there's no widget there's no menu why is that well that's because we just created the asset but we're not using it anywhere so we actually need to call for it and to call for it I will just go to my first person character blueprint here and I will right click and choose a key input so let's say key pressed or not key press just key I guess keyboard events and let's just find our or actually we can just choose any key right here e for instance and then once you select it if you go to the the input key option here you press here you can choose whatever key on your keyboard that you want to use so in my case I will use S4 Sun but s is backwards L for light l L key so when L key is pressed it needs to create a widget create widget and the class of the widget needs to be the one that we've made and I don't remember the name of it UI widget okay so class is UI widget right here and the owning player is going to be I believe player control error so this should by default work because we're inside of our first person character so it should work okay so the owning player uh should work if we compile save and press the play button and then if I press the L key nothing happens why is that well that's because when I press the L key it does create a widget but it does not show it to us so what we need to do is we need to add it to viewport add to viewport like that and the target is the widget that is that has just been created like so compile save press play help and now we have our um much more call it the sliders we have we we have the sliders okay so with this done we kind of want to um to then change up the to be able to use the menu right and also when we press L again we want it to turn off the the widget right so I can say when L is pressed once it creates when L is pressed again it breaks right so when L is pressed we we will use flip flip flop this flip flop tool right here so first time I'll explain you press the L button it goes through the a second time it goes to the B first time goes through a second time goes through b and so on right so it's flip flop um so I believe uh remove from viewport nope uh something about viewport remove all widgets there we go this one right here remove all widgets should be good enough try l l l l l l l o okay that works that works just fine okay that's that's step number one step number two is actually getting a mouse in there right and not uh not being able to move the camera uh so the mouse control is not using the camera but rather it's using the uh it's not rotating the camera but rather it can rotate the push the sliders so we're gonna get to that in just a second so I'm back uh in terms of getting getting the mouse to show up on the screen all you need to do is just to get your player controller which is you know the the player get player controller there we go and basically this controller has a bunch of um variables and one of them is called go mouse cursor and reset it so set show mouse cursor like that and when we add the widget to the viewport we also will tick mark this show the mouse cursor right so now it's going to be present to us on the scene if I compile and play this like that and we press the L button now yay the mouse but also what the hell is that right the mouse also controls still controls the uh the screen right so we we can still see um like the camera still follows the mouse so we can't have that so instead we need to change the game mode as well something something in game mode uh wait uh UI set input mode set input mode game and UI there we go sorry my my memory is fried yeah I don't remember anymore so set input mode game and UI there we go the player controller is exactly the same player controller that we used so far like that and everything else we can leave it leave it be we don't really need to focus in that much compile play let's go l we have the mouse as I move the mouse it does not change I can still click and drag with the mouse to change my the the way you know that angle it which I I'm looking at the world but besides that it doesn't change and look at that if I change the value hello it says hello to me that's what we wanted to see one last thing that I'm going to do is I'm going to say but wait what one thing uh just one second so yeah there we go so when I press L again the mouse is still there I need to kill that so when we press L again it removes all widgets but also it needs to show Mouse uh or sorry let's get the player controller again get player controller and for show Mouse set show mouse cursor we and take that just like so and then we set input mode game only and player controller is going to be our the same same player controller as what we've used so far okay something like that so we have a little bit more functionality in our player now last check we walk around yay all is good I made the banana bigger by the way um l says hello to us that's perfect we can change the sliders here as well that's perfect l that that works just fine okay so with that done we can now start working on the sun right so the sun itself we can technically technically you could change the where is it let's filter through lights like that environment directional light there we go so technically you could just change the angle of the directional light but I don't think that's such a good idea I think it's much better to just create a blueprint for the Sun and then change the values within that blueprint I think that is a much much better way to do it so that's what we're gonna do I will just right click and create a blueprint uh which is going to be an actor and I'll just call it Sun BP send blueprint open it up make it smaller like that and my sun blueprint will have only one object in add directional light Direction light there we go it's going to complain and say yo you're trying to create two suns you know one that's already existing and one that's fresh and new uh are you sure and for now we are sure later we'll substitute our original Direction light with the new sunlight from here okay as per usual we borrow the measurements or not not the measurements I guess um the angles in this case from the scene so before I do that I will actually just use Ctrl L to find a nice angle something something that's kind of nice but maybe a little bit come on come on hmm something like that something like that seems to be quite quite nice neat and dandy alright so now with the Sun um I'll go to my environment light mixer and here I can see all of the different things that have been changed with it and actually that's not many things and even here selecting directional light and choosing show modified properties only the strength has been changed to five Lux okay so let's go to our uh where's where's my blueprint hello there it is to our sun blueprint and here change the intensity to 5 Lux and then just borrow the angle rotation [Music] rotation that's all we need compile save close and now all we need to do is just simply delete this directional light that we have and instead well now now it's going to take a while for it to um re recalculate actually I kind of want to force recalculation one second reset filters is that a skylight that needs to recapture yeah that was the Skylight that needed to recapture now it's completely black and I will just slap in the Sun blueprint like so and slowly the Skylight should start catching up to it if it doesn't that's fine we can just go into here uh lights well let me just do that Skylight recapture there we go it caught it why why is it real-time capture yeah we we tick marked this that that's weird that it wasn't ticked Real Time Capture will solve the problem all right now with this done uh we have our blueprint that controls the the light right meaning that we can change things inside of it so let's open it up again and inside of our sun blueprint we can say hmm we can say well let's let's get the sunlight right and and set relative or set world rotation of the light set World rotation and every tick so we're using event tick it's going to check if the world rotation of the light needs to be changed or not I think this is the easiest way to to kind of comprehend there's there's more effective ways but this one is is the easiest and in this case what we can do is we can say well actually the the rotation the we don't want to change the rotation just yet so I'm just going to ask what is the current get world rotation what's the current rotation of the light and just feed it in like that so it's going to just get this these values here just going to get those and feed them into the world rotation input right here if I were to press play the light should yeah the light stays the way it should be right I'm just going to check one thing it still gets dark never mind and we can play with the banana oops or a book or a large bun that we can also hit as we walk through it where is it oh there it is bam kick it break dance banana book banana okay enough we're playing playing around so we have our sun yeah we have the Sun that has a blueprint where we check the original position of it and we just say yeah set it to the original position but now what we can do is we can add to that position and that's that's a strength of it right so I can say Plus or rather before we do that we let's break rotator and let's make rotator because because because because we will not mess with the roll instead we will be adding stuff or adding degrees to the pitch which I believe is the horizontal and we will be adding degrees to the yaw which is the horizontal wait vertical and horizontal movement which is vertical yaw is horizontal there we go like that uh how do we transfer the the the whatchamacallit one second I'll I'll get there the slider how do we transfer the slider information in onto here the sliders are in a completely different blueprint well we will use what's called casting so here in our widget blueprint where we basically just have when we change the sliders value just print string we will do something a little bit more right so first of all the sliders value is going to be um between -1 and 1 for horizontal slider right so we will say okay then can you multiply multiply that value by 180 degrees and it becomes between minus 180 and 180 meaning we can do full 360 Degrees horizontally for the sun rotation and we can say then that we want to cast to um the freaking Sun blueprint there's different ways of how to do it the easiest one which is also quite expensive in terms of performance is get all actors of class get all actors of class and here then we choose Sun BP so what it does it finds all of the blueprints that are derived from some blueprint in our case it's just one but in other cases it might be more and then it gives us all of them in a list and from this list we will just get a copy get a copy we'll just get the first one since it's only one Sun that we have it's going to be the only one right and then and then and then then we can access through here all of the variables that we have in our sun blueprint which we don't right now right now we don't have any variables right they're empty so we need to create two and I'm just going to make one just click on this plus sign next to variables for the sun blueprint and choose a horizontal or hori H well let's go for H Sun or H Sun that's fine H horizontal Sun rotation you know and choose it to be float number like that H sun is float and create another one and call it B Sun and that is going to be a vertical Sun rotation right and I can just simply drag them in here get them and H Sun connects to the plus that goes into the yaw meaning horizontal rotation and V Sun get visan goes into the Y right and these guys currently are empty right because they're going to be filled in with the numbers from from here so by default H sun and V Sun if I compile them uh make sure that you compile uh both are set to zero which is perfect for us right so now we get the original rotation so there are like XYZ numbers here and we don't add anything to them because this is zero zero right and we just show the Sun so this initially does not change anything but once we start messing with the sliders then it's gonna change so to create or rather to transfer the information we already have the sound blueprint I will just from the get I will set um this is horizontal slider so set h Sun set H Sun variable like that and that's our variable and don't don't forget the trigger right it needs to needs to trigger uh it's a little bit well actually this is not bad something like this works just fine and that's it that's our setup right I will do the exactly same thing for the V slider so I select the V slider click on on value changed like that crease it and I will just simply let's do it quickly get all actors of class send BP get the copy that we Sun this time V Sun vertical right something like that and then for um the value so it goes between um minus one and one so I can say I can either multiply or I can do remap uh numbers or how is it called isn't there a remap I could swear that there is a remap or is there only remap here right there's definitely remap one second um I'm just being stupid um math math rotator [Music] no that's trigonometry I don't care about float absolute sitting clamp division floor range map range okay so it's not remap I was thinking in grasshopper terms it's actually map range map range clamped in range a minus one in range B one meaning that what we feed in is going to be between these two numbers right like that the values from the slider and -1 should become minus uh let me just check the current position of the sun uh the current rotation sorry it's like at 10 degrees so it should be at like uh -1 should be at minus 30. and B should be at 30. something like that and let's just feed it and see if that that that works or not compile save uh let's play Let's see because this should work right whoa what was that oh that that was that that was the US stepping on the banana anyway um l drag whoa hmm well that's weird it keeps on building building up oh I know I know I know what's up with that okay so the problem is that I put the yeah because the problem is that since we're working on event tick it constantly keeps adding that value to the world rotation right so at first tick it does add that value but then the second tick it keeps adding more and more of that value so we're creating a loop so you saw that the light was just speeding up the sunlight was just speeding up so instead what we do is at event begin play I'm just going to grab the directional light and I'm going to say okay get World rotation get World rotation and yeah get World rotation because we keep keep checking it then and then it creates a Loops so we only need to check it once um on event we can play get World rotation and we need to create a variable that is going to be starting rotation starting rotation Rotator there we go just drag it in here set starting rotation so that's the starting rotation of the of the sun right so when we begin play we check what's the rotation of our directional light and we set this variable a value that can change to that right and then instead of constantly checking and constantly adding at every tick to that rotation let's just delete delete get World rotation from here directional light can immediately go to the here instead we will just say starting rotation get starting rotation and do that so now let me try to explain this a little bit in a little bit nicer way we press the play button so we begin the game and it immediately checks what's the angle of the sun and it saves it here it stores it here then we press the menu key right and we start messing around with the sliders so it already has this value stored right and it just adds the value from the sliders you know from the widget onto the originally stored light so now this should be neat and dandy if I press play press the L button and mess with this one wonderful okay sunlight like that I can see the Shadows here messing up um that's fine I will show you how to fix it that this happens with nanite objects and unreal unreal engine like nanite and retrace Shadows don't don't work that well but that that's fine I'll show you how you can fix it but that's the complete Sunset and you can see that in terms of complete Sunset we're already very close to it so I'm not sure if I like that and this is middle of the day okay so middle of the day seems good that seems like a good angle but the sunset or maybe the middle of the day could be even less so the bottom part of the slider needs to go even more into the minus range while the top of the slider needs to not do that right it needs to be in the plus range so second let's go in here so this minus 30 it can actually be minus 40 but 30 uh should be should become like 10 or so let's try this again l just lift it immediately okay that's cool and we get even a little nice really nice sunset sunset Vibe I keep stepping on that banana okay so that that kind of works uh it works quite quite well so I I think we can we can call it oh you don't see the slider did you I think we can call it a success right now let's talk about that this horror show that's happening here so to fix the lights this kind of a shadowing bit here um you need to sacrifice a little bit of performance um this is because we are using this nanite technology and it's kind of approximates the shape but unfortunately with Ray Trace Shadows it also like that the Shadows are approximated on it are are really messy um so there are a few ways of how you can fix it one is r dot or wait can I um retracing nanite mode set setting it to one uh might fix or retracing normal bias setting that to one also might fix it but in my experience it only fixes it uh until the next time you run the the script or you you run the project so a more permanent fix is actually sacrificing the little bit of um the Computer Resources so let's say this this couch right here let's go into it uh you just simply right click asset actions or you can I can show you once with the full on mesh editor look so here you go to nanite settings and you choose pullback relative error to be zero apply changes save close your couch is now correct right and the shading on it is just fine um for everything else you can just simply select all of these bad boys asset actions so I'm selecting now multiple objects asset actions bulk edit via property Matrix and here I choose nanite settings blah blah blah and let's find fallback relative error this one the most important one that needs to be a zero I save that civil [Music] close that okay this didn't didn't get to this one uh so as you can see it's a little bit annoying but once you once you do it once you don't need to do it uh do it again all right so let me do that again real quick relative error zero shading is fine right so for any object that really messes up with a control l come on give me there we go so for any object that messes up your uh shading uh you just simply do that um go in here foreign right um as I said before Universal uh fix for this let's find another one where it's still messy maybe we won't be able to seems like I cleaned most of them maybe outside maybe some will be outside no it seems to be a o k e never mind so the universal cleanup of this is r or wait how is it called r ray tracing nanite mode one r dot Ray tracing Dot nanite dot modes one like that fixes it uh and then there's something something else wait a second oh yeah a ray tracing normal bias uh setting it to zero or or was it setting it to two as you can clearly see I am very very bad with the commands so I'm not teaching you the the command line in my opinion it should be um all of these should be tools and we we have way too many way too many commands Okay Press Play Let's try uh let's look at the final result of what we have so far uh we're running at 50 frames per second which is acceptable the couch looks fine just fine the banana is doing banana things now it's a book now it's a candle bullet and now it's kicked and lives right there and probably Collision messed it up um then we can l to change the angle as much as we want nice nice nice nice and that is it oh yeah and we can of course L again uh e to change the materials and E to open or close doors and do some some feet here I think that this is enough for you to get a sense of how this whole interaction thing works I don't feel like there's any any more um variations of tools that architectural visualization would require at least that intermediate level um being able to add like other characters that move and that talk with you and so on that would I I would consider that to be Advanced I wouldn't consider especially for architectural visualization I wouldn't consider that to be intermediate level step so we'll finish off by talking about how can you package this project into playable player bow game that you can send to your clients for them to check out right so under settings the first thing that you check under settings under project settings here under supported Hardware you need to make sure that it's such a desktop maximum right supported platforms typically I have everything here unticked except for Windows because that's what we're going to be packaging for in terms of packaging let me just quickly check nope I don't need to change anything here in terms of maps you do need to choose what is your start the starting map and you know the thumbnail and whatnot so editor startup map let's just quickly change this uh it's gonna be building one in my case building 1 thumbnail uh for the thumbnail you can choose whatever image you want if you have one um I will just find my paw image if I have it yes I do oh that looks bad the POI image does not look that great ah it is what it is that's fine for the map I will use building one so that's the map that is going to be run run when when the or wait sorry editor template map oh uh sorry the game default map that's the one that's going to be ran at the start when your client opens up the game and that is it I believe it does ask me to restart the client now so I am going to be restarting but before I do that I will just quickly show you under platforms under Windows now you will be able to choose your packaging type so it can be shipping it can be development or debug game if you want to kind of package it for the final output you choose shipping if it's just for you to check if everything works it's for development right so in my case I will package it for shipping um so I will switch that and you just simply package the project I will not be doing that because I need to restart but you you would right then you find a folder Where You're Gonna Save It click select folder and it's just gonna go it's just going to start like counting and packaging the the the project for you it takes a long time uh a few a few hours maybe even um one last thing is you might it might give you some errors saying that it can't package and so on usually those errors relate to a visual studio uh you not having Visual Studio or you're not having the dot net uh framework I'm just writing it here so that you can it's easier for you to Google what's what's missing but basically if you have.net framework install the correct one and visual studio installed then there's no reason why uh you wouldn't be able to package a proper project for your clients okay so I'm going to uh restart and we will no I think we're done we're done you have already seen the final output of me recording right at the start of the video so it makes no sense for me to show it again so I feel like this is the this is the end of the course I hope you enjoyed it I hope you've learned something new if you like this kind of content leave a like subscribe and comment tell me because I'm thinking of mixing things up a little bit in terms of the content so I just want to get a sense of how many people are interested in this this kind of step and find use for this so tell me tell me okay I'll see you in the next one later [Music] foreign
Info
Channel: Gediminas Kirdeikis
Views: 6,651
Rating: undefined out of 5
Keywords: architeture, design, arch, architec, proces, how, client, clients, rhino, family, house, lithuania, company, very, good, architecture, vray, d5render, render, real time, free, for free, alternative, rtx, gpu, bim, revit, archicad, section, dynamic, drawing, visualarq, visualark, visual, arq, v ray, v-ray, v-ray66, skechup, material, rhinoinsiderevit, rhinoinside, rhino.inside, .insiderevit, zaha, hadid, beam, block, ibeam, grasshopper, gh, adaptive, shecule, schedule, cinematic, d5, d5 render, course, tut, ue5, unreal engine, archviz
Id: L_GkpEhCIkk
Channel Id: undefined
Length: 159min 40sec (9580 seconds)
Published: Mon Jun 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.