Blueprint Interface Demystified | Unreal Engine Blueprint Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign foreign foreign thank you Lucian so I was literally literally just saying something always goes fun in these tutorials and sure enough the microphone's not on what's up everybody welcome back to ask adev my name is Kevin today we are talking about blueprint blueprint interfaces and for those of you who have never heard them this will be an intro and for those of you who have heard of them but maybe there's a little bit foggy Etc we're going to demystify those to help you all out and give you all blueprint interface meta because they are awesome they can do a lot of really cool things to help simplify and make your just all of your Blueprinting a whole lot simpler so and also if you don't know what they are you may inadvertently be painting yourself into a corner that you don't even know about and what I mean by that is as you can do a lot of really cool stuff without even realizing blueprint interfaces exist I wish somebody had explain to me what they were how they work in simple terms so at least I could it would have planted a seed for me to use those in the future so um we're gonna get started with that we're gonna be working from scratch my name is Kevin we do these every so often uh one to two times a week depending on the complexity of the subject I currently work as a senior principal Tech artist at riot games and occasionally I even remember to turn the microphone on which is great so um black Panda and Lucian I saw your questions in Discord uh but for those of you watching we also have Discord and patreon and a bunch of other things I'll try to help out with some of those questions after this live tutorial so with that let's hop in because I'm actually pretty excited about this topic I'm excited about shedding some um light on some things that I wish some people had explained to me beforehand so let's get started and we're going to do this in context because I think it'll help paint a picture and starting from scratch uh this is Unreal Engine 5.3 it doesn't really matter um generally speaking we're working with all the fives lately I'm going to create a new project based off the third person shooter and I'm just calling this the BPI tutorial when we create this tutorial what we're going to do is we are going to set up three different blueprints for environment interactions we are going to make a door we're going to make a light and we are going to make a lever and we're going to set those up my you know the more typical way at first I'm going to explain to you some of the problems in doing that and then I'm going to show you why a blueprint interface will help you and how to implement it and how much faster it can be so let's get going first let's create a folder tutorial let's call this BPI ah it's already called DPI party we'll call this tutorial and I'll be uploading these project files to patreon afterwards for those of you that are looking for those okay now in our tutorial uh standard standard uh third person shooter project nothing nothing super crazy uh running around Etc we just want to create our doors our levers Etc so let's do let's do this we're going to right click and we're going to create a new blueprint and we're going to very quickly create three of these and these are going to be actors because they're going to be objects in the scene we're going to interact with them and everything like that so let's create this first blueprint we're going to call this blueprint actor the door and then I am going to duplicate the duplicate this twice all right so the first one we're going to call light or the second one we're going to call light and let's see if you can spell it right and the third one we're going to call Lever and we're going to do a little bit of light setup for each of these so let's go into our light blueprint I'm going to dock this so you all can see it we have our desktop audio okay we're good and in our viewport what I'm going to do this is our light I'm going to add a light in here let's just use a spotlight I'm going to make a couple changes to get this in place rotate it down 90 degrees and then let's make this thing super bright let's go 50 000 on our intensity making sure that's all coming through and let's make it a nice I think the hot pinkish reddish will show up better on the level compile and save that and let's draw our drag that into our level Okay cool so you can see right here this is our light now what we want to do what we're going to be doing with these environment actions is we're going to be uh walking up to each of these components and turning it on and off in the case of light activating the lever in the case of the lever and opening the door in the case of the door now let's go back let's set up our lever same thing let's just dock this and we're gonna do a little bit of light input as well because we have to create an interact key I'm going to open the full blueprint editor and then I am going to add a static mesh and we are going to be very loose in our interpretation of what a lever is and for this case let's just use whatever we think looks like we could use I'm going to use the ceiling lamp okay and in my viewport what I'm going to do is I'm just going to flip it over and pretend that when the lever is facing this way it's maybe on and when it's facing the other way it's off 40 is this what I want nope nope there we go so let's bring this up okay so this is our lever facing one way let's compile that save it and let's just drop that in our scene and the idea is when we go to activate this lever the light is going to flip to the other side just like you pull in a giant lever to open a door or something like that okay last one we have like I said very light but still good practice a blueprint setup especially if you're new is we're going to create a door we're going to do this by adding a cube and we're going to play a little bit with the scaling of it just to make it tall and door-like and we'll see how big it is once we drop it in here we could probably make that a little bit bigger let's make that a little bit bigger okay maybe a little bit wider okay so for all intensive purposes we have our three interactable environment objects and now what we want to do is we want to set it up so we can interact with them but first just because it's fun let's go take a look this is our our light switch I'm sorry but that could be a light switch but this is our lever this is our light and this is our door now let's set it up so that we can actually each of these has its own interaction if you will so we're going to be creating a couple of events in our event graph let's create a new event this is for the door first we're going to add a custom event and this custom event is going to be Event open now I am specifically naming this open door because I want it to be clear um when we get into casting a little bit later what this is doing and all we're going to do in here is we are going to show and hide the door as if it's opening we're not going to animate or anything fancy because the point of this is blueprint interfaces so let's just do this and what we are going to do is we are going to set the visibility on this and we are going to set it to be what it isn't currently so if I get the visibility on our Cube and then I say okay well currently if it is visible I want to turn it invisible and if it's invisible I want to turn it visible so I'm going to throw in a knot here and that is basically just saying it will be the opposite so when we call this function what's going to happen is it's going to come in here it's going to check if the door is visible and if it is it's going to set the new visibility to not visible and vice versa so that is how we're going to open our door if we would like to see this work begin play we can put a delay just a test of two seconds and then we can call Open Door Open Door just to test if we go play two seconds the door goes away so we can now open a door but that's not really how we want to open the door that was just a quick test so we're going to be implementing these functions for each of these objects now the light is our next one in our event we're going to create a new event this event is going to be event toggle light and what we're going to do is we're going to get our spotlight and we're going to check the intensity let's see if we can get the intensity uh we could we could set the intensity or we could also turn it on and off actually both would work but let's just do intensity because it's different okay and in this case uh what we'll do is we'll see if the intensity is greater than zero I press B and left click to create a branch that's the hotkey if it's greater than zero then what I want to do is I want to set the intensity to be zero otherwise I want to set the intensity to be 50 000. which is our default okay we're not even going to test that one because everything always works the first time in all live tutorials that's why so anyways uh let's see what we got just double checking our chat cool so we have one more blueprint to go just to get ready and this is all going to be clear here in a second let's take a look at our lover and what we're going to do is we're going to add an event add a custom event and this is going to be event to activate lever and all we are going to do is we are going to set our world rotation much in a similar way in this case we need a a branch node and if our world rotation is something we're going to set it to let's see here we got 180 540. those are some interesting numbers all right let's roll with it so let's just say that's our default we're gonna have to redo these because when we set World rotations these will be different oh starting this plus here I double clicked on accident give me one second so minus 40 and let's do 540. now for right now uh I think let's go into our viewport and let's see what the values are for the other side the other side would be 180 45 40. okay cool so in our event graph if this whatever condition is if it's false it's basically the exact same thing except positive 40. so what we want to do is with our static mesh let's get its current rotation world rotation and let's split the pen and then let's check to see if this is greater than zero and if it is we're going to set it negative and if it's not we're going to set it positive just like we did before okay so at this point we are set up we have all of the blueprints we need to continue our interaction but we need to be able to interact with them so in order to interact with them we need to do a little bit of keyboard binding so let's do that let's compile all of these and save them so we have them just to be safe and what we need to do is we need to create let's use the F key just for the purposes of the tutorial and in the starter projects under third person we're going to do that in our input section now the new starter projects use the new enhanced input system it's a little bit different than the way it used to be but it's still relatively quick to set this up but what we're going to do is we are going to let's just duplicate the move and we're going to call this input action interact interact not interrace interact okay and in here I want to set this to be a digital Bull and I want my trigger to be pressed and I can show you why in a second but let's save that okay and then we need to go to our import mapping default if we look at our mappings you'll see we have jump move and and look and all we need is to add our interact which is right here and we need to give it a key now when we give it a key you can hunt through this list or you can click the keyboard and press F and it will automatically fill it in for you and now what we want to do is we want to test this so in our third person blueprints we're now starting we've got the setup done now let's do the interaction and let's paint ourselves into a corner on purpose so we can show you exactly what's happening so for our third person shooter now that we have implemented the interact enhancements uh enhanced keyboard inputs if we right click in here and we type interact we have the input action for the event for interact and all I'm going to do is a print string here and we'll go with hello that's fine if we play now and I press F you'll see it prints hello at the top left okay if we do not give it this um not here in our interact if we do not give it this pressed if I get rid of this when we run our game when you press F you'll notice see how many how many hellos I print that was me just pressing the keyboard once because what's happening is as long as it's past the activation threshold it's going to be activating that printing it by changing that to pressed it makes it a one-time event so I mentioned that I wanted to show you why that was so we're going to add that trigger back in in this case pressed so we get a single press and we're there okay so that's that that's that that's that okay great now now that we have everything set up fast forward we're furiously working away on our Blueprints and we're building all of our interactions and we want our character to be able to walk up to any actor and interact with it well what we're going to do is when you press interact let's do a uh actor in radius I believe it is no sphere Trace four objects nah that's something I want to try this fine oh the one I want is not a sphere Trace I thought it was a sphere or something sphere overlap that's the one I want sphere I think that's the one I want sphere over sphere overlap actors here we go okay so what we're going to do is when this gets triggered we are going to use our current position so let's get a reference to ourselves and let's get the location get the actor location and that's where we're going to be doing our sphere overlap and the radius that we're going to work in let's set this to 500. okay and the object types we're going to make this we're just going to make an array and the array is going to be World Dynamic for example all right we're not going to worry about actors to ignore Etc so at this point we walk up we press F we want to trigger the interaction this is where we get into painting ourselves in a corner so you're like okay great let's just do a for Loop we'll for everything we find for each Loop what we are going to do is we are going to check to see if it's a door or a lever or a light makes total sense that's this is exactly how I would have implemented it when I was first starting so I'm going to take this and you'll notice though that if I want to interact with the door right off the bat we start with some of the challenges I know that there is an event on our door called open door so I'm like all right I'm going to do Event open door it doesn't show up why doesn't it show up it doesn't show up because this actor reference unreal does not understand that it could be a dorm so if you have not watched our video on classes and inheritance I'll put a link here afterwards that you can watch that one that will help clarify why the Event open door is not showing up here but what it means is in this particular case what we need to do is we need to cast to a door and what this does is this tells unreal to uh try to see if it's a door basically and if it is a door you'll notice that when I drag off of here I can open the door now I'm going to leave let's just test this one for now okay if this happens cast it to a door if it's a door open the door makes sense this is exactly what seems like you should do so if we walk over here and we press F nothing happens why does anything happen well first because when we come through here let's see here we're coming through we're getting it casting to door it's possible or radius is not big enough see here oh I chose World static you heard me say World dynamic see things always go fun let's try this again okay there we go so when I press F now my door is toggling on and off okay perfect so you're ex you're excited we're excited we're making games and we're like oh now I'm gonna make my light switch work okay but wait I have the same problem with the light switch but right now it's not a problem to me because I'm thinking oh I can get this done it's totally working so let's set this up in the most Straight Ahead way possible I am thinking to myself okay well I'm just going to for each of these I'm just going to double check three different things I have three potential uh things that I can interact in my world one is a door I'm going to cast the other one to a light um BP light and then I'm going to do one more cast to our lever our BP lever and in each of these cases what I'm going to do is if it's successful I'm going to call the interaction event that I made and this is where we get into this is going to be toggle light I believe it was there's our toggle light and then this one is going to be uh something lever I think it was activate lever is what it was now I purposely named each of these differently the reason I did that is because I wanted I wanted it to be clear that I was casting and I wanted it to be clear that I was calling this specific event for each of those Blueprints and that I cannot from my light drag off and try to open the door that will not work all right in the end what I would probably do just like in in practice I would call each of these actors would have their own interact function we're going to get to that but there's a reason why I named them all differently I wanted you all to be able to follow this so now as we go up for each of our actors we're going to go through we're going to try to cast it to a door a light and a lever and then depending on whether or not those are successful we're going to open the door toggle the light and activate the letter so let's test this out first we know our door works that's cool our light does not work our lover did something oh our lever is totally working look at that open says me with the lever so our levers working our light is not why is our light not working this has nothing to do with our our implementation or anything like this this is just because in a light blueprint in the viewport the light is so far off the ground it's more than 500 units away it doesn't have a collision so I'm just going to add in a collision here I'm going to add in a box Collision compile that save that and when we go back now when I walk up you'll see the light turns off right and if I come over here the lever toggles and the light turns off now why are they both activating they're both activating because I set the radius at 500 makes sense if I reduce my radius in my third person character to be maybe 300 maybe it won't be as sensitive and you can be even more controlling about this as you get into this but the point is we have now created interactable blueprints for our level let's talk about why this is painful and let's talk about why we've painted ourselves into a corner and this is important to understand if I want to create a new interactable character let's just start with a simple one so we've got a light we've got us we've got a lever and we've got a door let's say we added a switch and then we added a rolling door and then we added Etc and then we added Etc well for every single one of those we are going to have to do a cast and for every single one of those not only are we going to have to do cast we're going to have to call the function that was implemented specifically for that type of blueprint Open Door toggle light activate level or flip the switch whatever it is roll the door it doesn't matter it doesn't matter where they are this will become a giant mess of casting so one there's a maintenance thing here it's kind of a bummer from a maintenance standpoint now even without a blueprint interface there are things that you can do about that you can start doing things like having inheritance for example again this goes back to that whole blueprint classes inheritance and casting video if you haven't done that video you can go back and look at that with that being said there's another reason we painted ourselves in the corner beyond the maintenance and that is the casting so this is almost Loosely speaking because we're referencing every single one of these Assets in our hero blueprint we're basically whenever we load our hero we also have to go load all of these things even if they're not being used that's not a good thing that's a no bueno spot because we're trying to be efficient about our memory we're trying to be efficient about our implementation so imagine that we weren't talking about interactables maybe there's something with an enemy or maybe it is an interactable it doesn't matter and you don't get to the enemy until the boss fight but your enemy there's something that you want to do to interact with them but you have a cast in your hero blueprint that means even on level one your enemy is going to get loaded your hero is going to get loaded even though they're not even there because it needs to have a reference to it so it knows how to cast so there are performance reasons that we don't want to work like this so we've got maintenance we have the ability to extend and then we also have performance reasons why we want to find a better way than doing this casting and that better way for today is a blueprint interface so how are blueprint interfaces going to save us well with a blueprint interface this is this is the way I want you to think about it okay the way a blueprint interface works is there's a lot of fancy explanations for it they're all somewhat confusing Etc the easiest way to think about it is think about a blueprint interface as almost like a messaging system and if an actor knows how to talk to that messaging system it can use it to send information call events and do things so if I'm the hero and I know how to use the blueprint interface for interaction that means that anybody else who understands interaction I can send messages to so I as the hero can talk to the blueprint interface interaction messaging system that messaging system will then pass those messages on to anybody that cares about them and knows how to understand and in fancy speak Implement them so let's go back here what we're talking about then is we need a messaging system that messaging system communication system is going to be our blueprint interface so let's create one and let's start setting this up so it's clear so first we need our blueprint interface so let's go back to our tutorial let's right click and under blueprints you'll see one here that says blueprint interface now I had trouble finding this in classes so just in general I will click on it here now this blueprint interface I am going to call uh I'm going to be specific about it I'm going to call this an EnV interaction all right and all I have done at this point is created a messaging service for anything that has to do with environment interaction now within this interface there's not a lot you do here it's kind of confusing when you set this up all you need to do in its simplest form is tell the messaging system how to address an envelope if you will or what you can put in the envelope in this particular case it's a function and we're going to call this function interact okay I'm going to rename this to interact okay what that does is that tells the blueprint interface system that anybody who wants to talk to it needs to understand either how to send messages to interact or how to respond to messages called interact all right that's it that's all you have to do in order to create the entire messaging system that will allow our hero to communicate with our environment interactables however there's another piece remember I told you you need to be able to know how to talk to the interaction system so how do we tell a blueprint that I understand the environment interaction system well what we do is we go to each of the characters that we want to be able to communicate and we do something called implement the interface okay Arkham we'll get to that question at the end I'm going to continue uh just kind of with our blueprint interaction system and we'll we'll take just open questions at the end um if there's something specific about what I'm doing I will definitely hop in those right now now so all we have to do is we have to tell our hero character that it knows how to talk to the blueprint interface for interaction under your class settings over on the right you'll see this implemented interfaces and there's nothing here right now because we defined our interaction one in fact let me just make sure we compile it and say that because we Define our interaction one so once again class settings over here implemented interfaces all we're going to do is we're going to choose this interaction BPI enter an EnV interaction okay so here we go here's our BPI e in the interaction now this character knows how to talk to and receive messages from the the blueprint interface for environment interaction okay we need to do the same thing to each of the three of our implemented interactables at this point all right so on again once again under class settings implemented interfaces let's go ahead and do BPI and EnV interaction let's compile and save that the same thing here class settings repetition is great for learning implemented interfaces BPI EnV interaction and then finally on our door class settings implemented in phrases BPI environment interaction one sec okay so now all of the actors that we care about know how to talk to the blueprint interface the messaging system for environment interaction but what do they do with it how do we make it work okay well once they know how it works they also know how to talk to it so for example in our third person character what we can do is we can right click and if you type interact okay you'll see a function called interact all right and what this is doing is it's basically just calling into that messaging system that blueprint interface system and it's just saying interact and so what we're going to do is we are going to replace all of this with one call no casting so let's do that for each of these let's move this out of the way let's get rid of all these pins and let's connect this in except I might have gotten the wrong interact here we go blueprint interact I think it's the message that we need okay so that's going to send a message to interact okay now if this works when we go up to the door let's see if we can print a string so now the hero is sending a message to the interaction messaging system blueprint interface saying interact and now we want the door to respond so in order for the door to respond I am going to you see here's our interface if I right click on it I can implement the event you'll see here it says event interact and it even has the fancy blueprint interface icon okay so now let's see here hold on obviously you already have them made so I'm assuming that's why you added it to all them but wouldn't it be better to put it on a parent actor absolutely yes so black Panda black panther brings up a really good point I'm I'm implementing I'm adding this interactable event or the the blueprint interface implementation to each of my three actors for the purposes of the tutorial generally speaking you would probably have a parent class that all of your interactables inherit from and then you would only have to put it in one place however you might have more than one interface and there might be more than one reason so I'm using each of these three actors to represent a different class even though they're all kind of doing the same thing I'm using these to represent a different class just for the purpose of showing how quickly you can use it to simplify and communicate Etc to different things as well but yes ultimately we wouldn't we probably wouldn't do all three of these we would these would all inherit from an environment interactables or maybe there'd be a couple of them Etc okay so theoretically if we're inside or interact and our messaging system is working we can say Open Says Me that was a great question Pam and again if you're not familiar with classes and inheritance check out that video it'll help make that question make sense and be clear so theoretically if our messaging system is connected properly when we go to the door and we try to interact what should happen is we should see open sesame print in the top see if we got this or if everything goes fine see how it says open sesame in the top yes I love it when stuff works okay so now now that we know that it is implementing the messaging system is working the hero character is just saying hey interact the other actor I don't care who you are I don't care where you inherit from uh just do you know how to interact and it sends a message it tells it to there's no casting if the other actor doesn't know how to interact it's it's a silent fail it does nothing wrong nothing bad happens it's great then on the flip side for our door because we have implemented the interact event this character now knows how to interact so we can implement this event for each and every single one of all of our characters so let's go ahead and do that here real quick okay so let's go to our level same thing I'm going to right click on the interact interface that shows up here now that we've added it and I'm just going to say implement the event and in this case the event is interact and for this is our lever we can print string pull the lever we'll just do the uh double clicked again every time I double click it opens C plus plus no not right now okay so let's do this is pull the lever so now when we walk up to the lever we see pull the lever all right we are almost there now we're not going to I'm going to skip all that I'm going to skip that step for the light so let's just under our interfaces over here on the left in our event graph right click and implement this now the blueprint interface messaging system is working beautifully I basically say tell anybody I'm trying to talk to to interact if they know how to do it they do it that's it that's all it is no casting no preloading no direct links super performant and very modular it's very easy for me to swap out what what happens next it's also very easy for me to change who does what so what I mean by that what I mean by that is in the case of the light we don't even need this event anymore we don't need a custom event for toggling the light I can just connect straight into here with interact okay same thing for the lever I don't need this custom event for the lever maybe I'll keep it around I could even I could keep it around and connect this in that way if somebody else wants to um activate the lever they can but I can also have my interaction trigger as well and then finally for our door exact same thing we don't even need Open Door anymore what we are doing is we are thinking ahead all of these actors are going to be utilizing the same logic in the sense that somebody walks up to them wants to interact with them and they do whatever their specific interaction thing is but the the connecting piece the messaging system that makes all of that happen is the blueprint interface so the hero says do you understand how to interact through the blueprint interfaces the other characters say I do and if they do they do their thing so now that we have this all connected we have literally taken our hero stuff and I'm just going to comment this so that it's here for anybody who grabs this stuff this is going to be the old direct method casting way and let's just make it red for anybody who opens these assets all of that was replaced by a single call using the blueprint interface and now let's compile and save all this stuff all right and test it here we go so when we walk up to our door now if we interact we should be able to open and close the door we can lock up to our light same thing we can turn the light on and off which is awesome and finally we can toggle our lever this is how easy blueprint interfaces are I don't know why I don't know why it's often so hidden I don't know why it's sometimes so cloudy but if you just think of it as a messaging system and as long as you speak the language there's another way to think about it as long as you speak interact you know what to do you can Implement what you want to now you can use these interactions for a lot of different stuff this is just a an example of it's a pretty tangible example but you may have something like climbing on large enemies or climbing for example maybe something special happens with climbing does your do the characters Implement uh that kind of um that kind of behavior or not you can use interaction or maybe you walk up to something and um I'm trying to think maybe material swaps there's there's so many different uses for these things and the coolest thing about it is every single actor can have its own version of what they do when they interact maybe they run around or maybe when you interact with them it explodes causes damage who knows there's lots of different things that you can do with this but the big thing here is in your hero character now or wherever you're doing these interactions you no longer have to test to see what actor it is figure out remember trying to remember okay for the door the event was open door for the light it was toggle light and for the lever it was activate lever all different nope not anymore all simple all straight ahead everything is just interact it's super efficient and it's uh very modular so we can decouple a lot of our creation from the actual implementation so that we can swap things in and out much easier so I think that wraps up a very kind of Straight Ahead tangible real world example of painting yourself into a corner and then showing how blueprint interfaces can help us back that out and make it very easy for us to swap things out and it's also a lot faster it took us it only took us you know a few seconds to add the blueprint interface to all four of our characters add the event and and plug it all in it's very quick so does anybody have any questions about this this particular tutorial on blueprint interfaces before we before you just move on to open questions should we go ahead and take the time to implement to rebuild our blueprints so that they all inherit from one environment interactable would that be something that you all want to see as we wrap up the last 15 minutes okay while we wait for you all to chime in let me see what uh archatum has in here how can I design an educational laboratory in the metaverse using only one create an interactive environment to which I can communicate with those and take lessons in the laboratory holy smokes um I mean you're you're basically talking about building an entire experience uh so you're gonna have to figure out in the metaverse like the metaverse is such a [Music] shrouded place like where is it what is it but just like any other game or system Etc you're going to have to set up most of the same principles of any other interactive experience you're going to need base layers for communication whether it be text or speech or Etc you're going to need servers to facilitate the communication maybe you could use blockchain um and then depending on how visual you want to be you know an environment and everything to work in it's and and basically just build it out but okay so it looks like we've got a couple votes to go back in and at least re-implement our our simplify this even further to uh leverage inheritance so let's do that so what we're going to do is we have our door our lever and our light let's create a new actor okay and in this case this is also going to be an actor and this is going to be a blueprint EnV interactable or able I don't know anyways we'll just we'll just do this okay and in here what we're going to do is we are going to same exact thing we're going to add the class settings we're going to implement the interface for um the interaction okay and then what we're going to do is at that point I mean that's almost done so this actually it's it's kind of done so here's all we have to do if we take this and we we could actually remove let's see here let's remove this is that gonna be the easiest let's see what happens if we just do this I haven't tried this before if we just re-parent this blueprint we're going to re-parent this to the EnV interactable it's not going to be happy about that so let's just re-parent it and let's compile it and then from our class settings we have our inherited you can see all that happened was our implemented interfaces we used to have the BPI environment interaction is now under inherited instead okay so um that's it now there's a couple other steps we can do if we go to edit uh file repair this blueprint and we change this to our e and B again and we go ahead and do that compile that and then lastly our light we'll re-parent this this is just rebuilding our class inheritance reparent diet okay now what we could do and this is where we get into it each of these kind of has their own thing anyways one is setting intensity one is setting a world rotation and one is setting visibility okay there hasn't been that huge win by making all these inherent from the parent but there's one other thing we could do that might help help you see the power of so it still works as you can see but the power of inheritance here is let's change one thing okay for our door what we're doing is we're setting the visibility let's see here can I just can't move this up can we do scene roof let me see hold on trying to figure out a way to make this get default scene root can we set visibility on the scene room I think we can okay so let's do this let's I'm not sure if this will work but we'll give it a try so inside of here if we add in uh if we implement this event and then here we grab our scene root and we set our visibility to get the visibility exact same thing we're going to set it to be the opposite of what it is using the knot okay now what's going to happen is we need to go back so this is going to set visibility so let's go back to our door we technically don't need this anymore if this works so let's go back and let's see if we can still hide our door um I guess scene roots not working oh wait hold on let's go back to our door implement the event add call to parent function maybe that's what we need let's try this real quick no see I think we're getting here but I don't think setting the visibility on the route works so this is our door are we hitting this yeah we're hitting it but setting the visibility on the scene root doesn't work um how can we make this more robust just to continue out the example uh what we could do is we could get children and then for each one we could set the visibility this is sort of dangerous too but let's just roll with it let's just see what happens in the visibility we're setting is from this one don't yes compile see if that works so that works okay now where I was going to with this are our default our parents interactable blueprint now we'll set visibility of anything so remember how we were doing the light before we were doing it based on intensity we can change that what we can do is we can just delete all that compile that and press play and if we come up to our light now it's turning on and off even though that function's not even implemented it turns on and off and the reason it turns on and off is because we're leveraging The Inheritance with the blueprint interfaces because they do the same thing we're going through and we're just turning the components off however the lever well it's still going to work right now but it won't work in um it won't work if we were to just get rid of this so here's the problem if we go to the lever and we delete all this what's going to happen is rather than toggling the leather uh the lever what's going to happen is it's going to turn on and off because that's what the default behavior is for it so you'd have to make a choice you would either have to choose to override your lever so now what's going to happen is you see how we have this event interact this interact locally overrides the parent so it will now the lever will toggle and it will not turn on and off like it did before so in that particular case you can use a combination of inheritance and blueprint interfaces to simplify and consolidate down Etc but it would take some planning you have to think about it so you can kind of see you you might set up your blueprint interface messaging system to be a little bit smarter about what it's supposed to do but then that can also get very complicated so in these cases I want to turn it off in these cases I want to toggle it in these Etc you get the idea so in that particular case you have to be you have to kind of think think about how you might want that stuff to go so I'm going to actually undo some of these things that we did just because uh so that I can save this out for kind of where the tutorial ended for those of you that end uh you know if you want to grab these materials and stuff like that from from patreon so let me just double check that this is all working before we wrap this up foreign looks like we are good to go all right on the whole scale of something always goes fun that was uh pretty low does anybody have any other questions before we wrap up this tutorial we actually have a lot of really cool stuff coming on Wednesday for 2.5 D characters that stream as I mentioned is at a different time than our usual time that's going to be at 7 30 in the morning so we're going to be taking a character and we're going to be using the exact same character to implement both a Sprite bass workflow and a mesh based workflow so that's coming all right the Jolly Grim Reaper thanks for hopping in the Stream the Harrison can be very powerful and use and yeah it does require a bit of planning where it doesn't go so well is that if you have a few people developing different parts and you want to utilize the file per asset system exactly so and that's where just planning with your with your teammates and stuff and also again that's also why things like building components are great because it allows you to share uh work so for example if your hit flash system and your material manager and your Gear Manager and everything like that is componentized one person can be working on the gear while one person's working on materials and so on I can make your characters very modular uh and um for a multi-developer situations so all right y'all Jolly Rancher black panther Lucian young men Arch all of you thanks for hopping in and checking out the Stream as always um you know if you have thoughts on this topic if there are other things that you feel like would have been good to cover or you have further questions feel free to throw those down in the comments and our next stream is going to be this coming Wednesday we're doing one early this time 7 30 we're going to be talking about the 2.5 D experimental character workflow should be a lot of fun and we do have the patreon there's the Discord channels all kinds of fun stuff hop in check those things out and we'll go from there um I know Lucian blackpana had some stuff they had UL had some questions on Discord uh and and things like that so I'll hop over to Discord after this and see if we can't take care of that everybody else I hope the rest of your weekend is awesome anybody else who's new to the channel thanks for watching if you like what you're seeing help spread the word let people know what we're doing here as always hit me up with questions and I will see you all in the next live tutorial take it easy foreign
Info
Channel: Ask A Dev
Views: 3,867
Rating: undefined out of 5
Keywords:
Id: oTST9didni4
Channel Id: undefined
Length: 59min 16sec (3556 seconds)
Published: Mon Sep 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.