Blueprint Interfaces | How and Why you should always use it | Unreal Engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys today in this video I'm going to show you how you can use an uh interfaces in Unreal Engine and why you should always use it so let's get started so first of all I am going to create interface so I will go in my blueprint click on blueprint interface I will call this BPI interface after that I will just open it I will create a function I will name it like interact okay now compile and save this now I will open these two Blueprints and here I have created a custom event but just forget it I will add a blueprint interface inside this BPI interface I will call this double click on this for creating this event interact because we have added our BPA interface in this so it will whenever ever we call that interface it will call this event okay now in this thing thing I will just forget that I will add that BPI interface here also after adding that I will just call this print string again so it is saying I am yellow so because it this man is yellow accordingly I will add that for this Beast also inside this I in class settings I will add my BPI interface and then I will double click on this for creating that event and I will connect this node okay now I will compile and save now I will go to my uh player character this is my player character inside this I am I will call this uh call that blueprint interface so I want to call it like whenever I am clicking on this Beast or manin or anything it should automatically call its interface so I'm going to uh I will add input key all uh I will change it to my left Mouse button so whenever I click my left Mouse button it will do that line Trace I will get my player controller from this player controller I will get my hit result under Mouse under my mouse cursor by Channel I'm going to use the camera channel for this for the hit result I will just break it and I will get my hit actor from this thing and I will call my inter blueprint interface I will call my interact function yeah this one I will connect it to here now it's ready I will just collapse all this make a straight line now we can test it now you can see if I am clicking on this p is saying I am Beast this one will say I am green and this one will say I am yellow and it is calling uh it's uh on event like if I'm clicking on that green thing it is calling that I am green so accordingly you can add any kind of functionality for example you have any cars or anything if you want to like uh any kind of thing you want to add after this event you any kind of functionality you can add those things here so this is the thing and I will show you one more benefit for using this interface it will save the your memory also let me show you for example let's go in our Beast thing in our Beast rather than calling this event inct we will I will just remove this blueprint interface from here and and it became a interact function now it's a custom event now if I am going in my third person character now for calling for example just suppose we don't have any interface or anything so after doing the line Trace we have to cast to our blueprint so I will just cast It cast to BP Beast so after casting we can call our function that was interact not not this interact message this your blueprint interace we are going to call this function so you can see now if I am clicking on this thing it is still saying I am basted but there is one more thing I want to show you for example now you are currently you are casting it so if you right click on our player character we can see one minute where is it this is my player character if I click on this and see my size map you can see BP third person is taking 1.5 GB of memory currently and that's it that's too much but the most of this memory is taken by that BP Beast you can see BP Beast is taking 1.1 GB of memory inside this so because why is the why that happening because of this cast whenever we are casting it is creating a hard reference for that and when whenever we are we create the any kind of hard reference it will just take that much memory even even if you are not going to use that uh bpb store anything then also it will take the same memory so on place of that like if you just remove this thing and use our blueprint interface let's add our blueprint interface again uh inct inct message we are going to use this now if I compile and save and now if we right click you can can see from the SI map you can see now currently we are only taking 110 MB of memory currently only 110 MB and before that we were taking like nearly 1.2 GB or something so now also we can do the same functionality as before uh but we have to go ins inside our BP beast and remove this custom event add our blueprint interface again after adding we will just call this three and now we are doing the same thing if we play it will say I am B this one will say I'm green this one yellow so everything is working same but we are currently saving a lot of memory also so now if we check our check the size of our blue third person character you can see in the size only 110 MB because we are not making any kind of hard references for these things so that's a good thing in that reference viewer also you can see there is no BP Beast here so that's all for today I hope you got some to learn some new thing maybe and if you like this video please uh like And subscribe my YouTube channel and U if you have any doubts uh add those in the comment section thanks and have a nice day
Info
Channel: CodeFizz
Views: 713
Rating: undefined out of 5
Keywords: Epic Games, UE5, unreal engine, ue4, Beard games, Beardgames, unreal engine 4, unreal engine 5, epic games, ue5, gamedev, unreal engine 2020, game dev, game developer, indie gamedev, Indie Game, unreal engine blueprint interfaces, ue4 blueprint interfaces, ue5 blueprint interfaces, unreal engine bp interface, ue4 bp interface, ue5 bp interface, ue4 blueprint communication, ue5 blueprint communication, unreal engine blueprint communication
Id: fJxD0m6uh2c
Channel Id: undefined
Length: 7min 32sec (452 seconds)
Published: Mon Dec 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.