Unreal Engine Interaction System Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this tutorial i'm going to go over how to set up a universal interaction system inside of unreal engine so we'll be able to set up an interaction system that can be used for anything for example we can use it to open the chest or to open a door or do whatever you would like once the player interacts with it so the first thing you want to do is head over to your blueprints folder and just right click and you look for blueprints and select blueprint interface and you just want to call this interact interface and whatever has this interface in our game the player will be able to interact with it so we're going to do is head inside here so just double click and underneath functions you just want to rename this and call this interact you can also right click and click rename if you want to rename it okay so once you've done that just compile and save it and we can close this so for our so for this tutorial the object i'm gonna make the player be able to interact with is gonna be a chest which we can open i'm gonna use this chess model for this tutorial i'll leave a link in the description of where you can download this exact model if you want to use it if you do use the chess model when you use it you just want to drag in the chess model inside of unreal engine and make sure that this import animation checkbox is just checked so it can import the chest opening animation okay so once you have done that or you have your interactable object what you want to do is just right click go for your blueprint class select actor and i'll just go to my chest and scroll bp and we want to head inside here and i'll just set that up so it has my chest model so i'll select skeletal mesh and select the chest so this has a bottom and a top so i'll just select one and i'm going to scale mine up so it's three just make sure this is checked if you wanted to scale in all its axes so i'm gonna add another component skeletal mesh and select the top half of the chest such as top and i'll also scale it so it's three okay then what we're going to do is go to its class settings and under interfaces we just click add and select interact interface and click compile and we can see that it has set up this interact interface then we want to go to the bank graph and just right click and look for our interact so inside of our um interface we made this event called interact so we're just going to look for it here just right click on it for interact so it's here event interact and event interact i'm trying to drive here and cool the event that i want to do so i'll make it do once and play the opening chest animation so i'll just drag in this and look for play animation and make this play the opening chest and then i'll also drag in skeletal mesh one and look for play animation and make this play the chest open top you want to go to the viewport and then finally go to add component and look for box collision and just make sure this box collection covers the whole of your chest then you'll click compile and then in order to make the player character be able to interact with it you just want to head over to your player character blueprint so reminds the third person character and scroll down and you want to get the key or bond that your player uses to interact with in the game so for this example i'm gonna make it when i press the one button it's gonna check if i can interact with any objects so right click and look for the one key when we press this one key you want to drag up here and look for for each loop with break and we're just going to see if we are overlapping any actors so you just want to drag off this array for get overlapping actors then we're going to check to see if any of the overlapping actors we have have the implement interact interface so we're going to drop here and look for it does movement interface for the interface it's going to be the interact interface if it does we want to drag up here and look for branch and if it does then we're gonna you want to drag up here and we want to call the interact event message and this will just run the interact event inside of whatever we're dragging with and then we just want to plug this back into break and i'll just double click and load this so it's a bit tidier and now like i compile we zoom out and we head back to our chest and head to the viewport one more thing we just want to make sure that there's box collision um it's overlapping full dynamic or overlap all so that our player can overlap with it i never just drag this in go play and i go up to this chest and i press one it will play the interact animation one more thing that i like to do with objects that the player can interact with in my game is if we just go to add component and look for text render i normally just add a text so i'm just gonna drag this up a bit and we can see it there and i normally have something like press one to enter wrapped and then if we just go to the details i normally make the visibility of this um visible so it's hidden or we can do hidden in the game so we just left we'll hit it again and just check this and then if we just select this box and scroll down and select on component again overlap and we can select the box again here and add on component end overlap if our player character so that is the third person character in this game so i'm going to look for cast to third person character if our third person character overlaps this box then we get our text renderer and we set hidden in game to be false so we can see it and if our thought doesn't have to leave this box then we can hide this so i'll copy this with control c paste with ctrl v and plug this into here and listen to here and then check so it's hidden again and if i click compile and play if i go up to this we can see if i press one to interact i press one i can interact with it if i leave then that text disappears and that's how to make an interaction system inside of unreal engine so we can use this system for many things such as opening doors picking up items and opening chests so ages ago i made a video on how to open a door with unreal engine using the line tray system although i think this system is much better or if you want to check out that video i'll leave a card to it now that's all for this video i hope you enjoyed if you did like subscribe and i'll see you guys next time bye
Info
Channel: Unreal University
Views: 46,122
Rating: undefined out of 5
Keywords: Unreal Engine Interaction System Tutorial, unreal engine interaction system, unreal interaction, unreal engine interface, Uisco, Unreal Engine, Unreal engine tutorial, ue4, blueprint, blueprint interface, blue interface tutorial, tutorial, how, to, how to, system, Press E, Blueprint Interface
Id: mZCP7xexdtw
Channel Id: undefined
Length: 7min 11sec (431 seconds)
Published: Sun Jan 23 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.