what's up guys welcome to new Unreal Engine 5 tutorial and today I'm gonna show you on how to make a hold interaction with a key I'm gonna be using the new enhanced input system on the 5.1 so let's get started it's going to be a very easy build for but first check out the link in the description to get out with some unreal ending courses on winfox so the first thing that we have to do is go and create the new input key so let's go ahead into third person and you will see that in input we have a folder called actions and now we can go ahead and store all of our actions here now of course if you're using any other template you can use your own one let's go ahead and right click go into input create a new in production so normally we call this EA because it's like the prefix now I do have a tutorial on how to get started with the new enhanced input system so I will be linking description so now we want to do is just put for example I don't know interact right you can call it whatever you want for what you want now if we go ahead and double click it on him um in here we I will actually not assign the key we'll do that later on in a thing called The Collection now there's a few things that we have to change over here first of all make sure that of course consume input is on this is just pretty much enabling the input and then you can put trigger and pause so when the game is uh you know pause or whatever you can also interact with it this depending on what you do and then there's a few things that we don't have to touch like for example we want to leave the value type to be a bull basically on or off now in triggers it's the thing I'm going to change so let's go ahead and add a new trigger and now you will see that we have a whole list of different trigger options created for us now the one that we want to use is hold now you have many other things right now there's also hold and release where you need to hold it and release it so that's when it will trigger but what I'm going to do is just say hey once you hold it for one second or whatever you say then it will go ahead and Trigger it so let's go ahead and enter that I know here you can change the time that it will uh it will need to hold so now with that said we can go ahead and save and now we need to go back into the uh collection so here is basically where we got all of the inputs on here and with this assign key so we just have to add a new one and then find the interact one that we have to scrape then here we can just press this button over here and then press the key that we want to uh interact with in my case or you can just search it here but I think it's easier and you can just put uh whatever you want here now you also have the option to override and put more Triggers on modifiers here but I do recommend doing so inside the proper input action right so now we can go ahead and save everything and close it now if we go into the third person captive blueprint or whatever character blueprint you're using now make sure that of course you are adding the mapping into the blueprint so you can use the inputs I'm going to find Space over here and we want to use the EA underscore interact it's going to be the first one that has action events the one with the arrow basically now we have a lot of you know different options trigger starter Etc so the one that we want to basically use our things on I'm expressing correctly it's going to be on trigger so of course triggered is going to be triggered when you know we are pressing and the timer went from that threshold so we go ahead and for example print string after one second of features holding it it will print now started this basically when you start you know pressing the key ongoing canceled with there are a few different things and then complete it when you stop um holding the key so I go more detail on this in my beginner tutorial now if I go ahead and press play you can see that when I press T and right now hold the net nothing's happening but now that you know a second happened you can see all of the hello uh prints the thing is that I am still holding the key so if I go ahead and release it it will go now the thing is that you know it is constantly spamming piggy even though I'm you know you're still holding it but we don't want that we don't want that if you're still holding it it will continue doing so so we want to do is go back into here input action I want to do it into the interact and now we have this option which just is one shot which is exactly what we want and it's just basically once it is triggered it will stop so now when I press play you can see that again uh code trigger and then it will print it only once so go ahead and quickly use some simple interface let's go ahead and go into user interface with your blueprint WB underscore interacting and the thing they're going to do is go ahead and find a canvas in the palette we can go ahead and drag it now we can drag things on here so we want to do is just get a text on the center of the screen and what we want to do is just put everything into zero I accept these size here I want to put like 120 something like that an Enlightenment 0.5 and then 0.5 so we'll be perfectly in the middle but there and then we can put this on interacting dot dot dot there we go yeah simple you know of course you can change it to be like a progress bar that fills up but this is just a quick example and now all we can do is go into the third person blueprint and on Startup we can go ahead and create this widget so when we start pressing the key so it's going to be the what was the interacting and now we can go ahead and basically add it into the viewport I know the thing that we have to do first is right click promo to variable it's going to be the interacting UI so we need to reference to it because we have to basically deleted later so now that we have all this uncompleted we just get the interacting UI and basically right click and convert it to validity kit so basically just in case uh it didn't create properly whatever it will not give us an error so if it does exist we'll go ahead and use remove from parent uh which is here and then set this variable to be false basically it's just deleting the um the widget so now when I go here and press play now when I hold the use the interacting and then once it is released now it says hello and of course in here you do whatever you actually want for example instead of printing hello I can say jump and the character will jump so if I go here whole T interacting and then it will jump so you know go ahead and put whatever you want here if you're gonna open a chest do so with an interface or whatever you need yes sir so that's it guys if you found the tutorial useful and helpful I really appreciate you collect the video and subscribe to my channel I have lots of Unreal Engine 5 tutorials so go ahead and check them out join my Discord server and follow me in all my socials such as Twitter and Instagram so yes without said bye bye thank you