How to Trigger an Event when the Player Collides in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial and today I'm going to show you on how to make a series of events or whatever you like when we uh pass through a trigger so it will be very useful for your levels to things when you uh pass through certain you know points this is going to be a very easy tutorial to follow um so let's get started so today we're gonna make that basically when you pass through a certain point an explosion will happen in our character and we will basically react though okay so now yes let's get it started all right so first of all we need uh to of course have our level opened and basically decide where we're gonna put on the trigger in my case I'm just going to going to select this one I am basically unduplicated and basically move it uh so I can kind of Mark um you know the the my path so it's going to be easier for me to know one where is this trigger okay so okay so now let's go ahead and add the trigger so what we want is to go in here and quickly add to project uh I'm just gonna search in all classes and we are just gonna type trigger and you can see that we have you know different um types of triggers but the best one for now and it's just gonna be the normal trigger box okay you can use different shapes like capsules fear to bit uh you know to fit uh better your level whatever but I'm just gonna make it like that's okay so basically when our character will pass through here um you know we will basically call event or something okay all right so now what we want is to open the level blueprint because we need to reference okay so just go in here uh in list of uh wall Blueprints and then click it and open level okay so this will open the third person map level blueprint okay and now what we can do is Select our trigger box in the outliner okay that we use as uh have added go back into our um level blueprint you can right click and then we have uh we can create a reference or we have two things here okay we're gonna add an event or color function we will add an event so it's going to be on collision and on add-on actor begin overlap so when we start to touch the trigger we will launch something okay on the trigger box cool so first of all let's um you know overlap actor uh we're gonna make sure that you know it is the player so we're gonna just cast to BP uh third person character okay so if the cast is successful we'll continue just to make sure that there's a player now and what we're going to do is basically instance a uh spawn in a system or emitter okay so it's gonna be in the midterm at location okay so emitter is kind of like a particle system and basically uh if you import the starter kit on your starter things on your um you know on your Unreal Engine project you can just type here explosion and we'll basically have an explosion okay so now we can select it and there we go okay and the location um well we can just get the location from here so get actor location and then we'll spawn it right on the player's position as we're connected from the cast Okay uh the rotation and scale we don't care about it it's gonna be cool like this and yeah that's pretty much all what we need um like actually things will start to happen now but also to make it look better gonna play a sound I'm just gonna make it 2D to keep it simple and I don't really have imported an explosion sound or something I don't know okay yeah it seems like and it seems that we have some explosions so I'm just gonna say the explosion cool Q sorry as it's gonna you know have a random between these two so it will be um a bit more Dynamic and sorry I just realized that it isn't overlapped actor sorry it's other actor okay so just plug that in into the cast and now yes we can hit play and we can just go into my trigger and when we pass you can see that explosion appeared and this sound um maybe you cannot hear the sound because I have it really low uh for the recording but uh basically it will happen and it will happen also and one more time okay um we can make sure that that will only happen once if we go back in a third person map and I'm just here after we you know collided and after the cast and we can just put a do once note and this will just do it once uh and if we never reset it well we'll never reset so now we can pass it will happen and then it will not happen again so there we go it's my you know it's more control basically now you just make it so that um we can basically um Ragdoll our character okay it's real quick so I'm just gonna make a new custom event in the third person character and you cannot say rag okay which is the third person character you can just opening in content third person blueprint character anyway just get a enter a point custom event okay and we're going to just drag the mesh drag this and say and simulate uh physics set similarly physics plug this in here and turn this two and then we can go into the mesh and we can just go down and in Collision presets we can put this in physics actor now we can compile on Save and now we can go back in a third person map and write um yeah we can just do it here and we'll actually hear it there yeah is drag this buttons here and drag this uh from the cast I'm just gonna say rectal so now we can actually call all events so we can use I'm gonna put in here in the middle and now if we compound save and press play if we pass there we go so so cool so that was it guys if you enjoyed the tutorial and found it helpful please I would really appreciate it if you could like the video and subscribe I have lots of Unreal Engine pack tutorials in my channel so go ahead and check them out also if you have any uh tutorial I want to see uh comment it down below so with all that said bye bye [Music]
Info
Channel: Gorka Games
Views: 65,221
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, trigger, tutorial, quixel, megascans, unreal engine tutorial, trigger event, ue5 triggers, ue5 trigger tutorial, ue5 trigger box tutorial, unreal engine trigger event, unreal engine 5 trigger event when player collides, unreal engine how to trigger an event in a level, unreal engine 4 trigger boxes, unreal engine 4, ue4, unreal engine 5 event trigger tutorial, ue5 tutorial trigger event, how to make a trigger event in ue5
Id: H2I7I8blgn8
Channel Id: undefined
Length: 6min 11sec (371 seconds)
Published: Tue Sep 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.