How to Make a Safe Zone in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to New real Engine 5 tutorial today I going to show you how to create a safe Zone it's going to be a very easy whe to follow so let's get started all right so actually some videos ago I made a how to make a danger zone video so you want to check that out I will link in the description and this time it is the opposite right a safe zone so we will display this message when we enter in the safe zone so let's begin by making the Zone itself so let's go to the content browser just right click create a new blueprint class and you know select an actor as we will place it in our world let's name this something as bpor safe Zone and let's open this up so the first thing that we will add to this safe Zone will be basically a collision and this will be a box collision and we'll name this our trigger so as soon as our player enters inside of this trigger we will activate the safe zone so make sure to go down under Collision set settings in the trigger and make sure that it's set at has overlap all Dynamics so our player can go through it but we will trigger it and with that said we are good to go another thing want to make sure is to go here just for testing and disable hidden in game that way we can still see the box when we play the game just to kind of see you know the bug and test and all that good stuff and then what we're going to do is go down and you can see that we have an on component begin overlap we're going to go ahead and add this event delete the other existing ones and basically when something enters in this trigger we will trigger this so we need to make sure that it is our player so let's get the other actor and do a hashtag note in this case it will be something as player but of course now we need to add this tag into our player so let's go into the third person folder blueprints open up the third person character blueprint or whatever character blueprint you're using go to class defaults search any tags for tag and then go ahead and open this up and search for well not search for but just type layer and there we go so now the third person C blueprint has the player tag and now it will detect it here when it goes inside of this trigger and now what I need to do is of course drag from here do a branch and right after that what we will do is do a print string over here and then we're going to go ahead and just put uh entering save zone right basically is pretty much the same logic that I used in my you know Danger Zone video all right so now let's go ahead and distract this safe Zone into our level lock this scill put it to maybe something as you know 10 okay um make it a bit higher press play we have this safe Zone enter and boom entering safe Zone as you can see the top left of the screen so that's going ahead and working so now let's go ahead and create a UI widget that will basically appear so for this let's right click go to user interface create the widget blueprint select use a witchet let's name that something else that will beore safe Zone let's open this widget up and the first thing that we will do is go to pled add a canvas panel to our screen and then we just go ahead and drag the text over here then in the anchors we'll place it at the um Center top right and we're going to go ahead and just put something as entering uh save area right or save Zone whatever you prefer to name it and then let's go ahead and center the justification and then on size X and Y we will go ahead and just make it bigger and then on the font we'll go ahead and put it to me like um I don't know 40 something like that and then with that said we're good to go so going to go ahead and you set the anchors uh sorry we already said the anchors uh the position X and Y to be here right 0 0 and then the alignment to 0.5 and 0.5 and that way it is exactly the center and the only thing you need to do is get the position Y and drop it a bit so right now it it will be here kind of this you know top part now with the text already in place we can go ahead and just create the widget and we will make all the animation and so one later on so let's go to BP save Zone just go right after we print actually we can remove the print we can directly just create the widget so let's go to create widget uh node and select the class which will be WB safe Zone then the return value we just need to go ahead and get it and add it to the viewport okay so it will be added to the player screen and now if I go and press play go through here we can see the text at the top but of course when we acit we still see the text so let's go ahead and do all this so let's go to the uh safe Zone widget and create a new animation right this will be something as uh enter all right enter there we go so let's go ahead and select the text add it with the track and then just go and do a nice uh fade in and Fade Out so but we just get the font um color and opacity sorry set it at beginning to be zero and then just add a key frame then maybe 1.5 seconds later you will put it to one add a g frame and now we have this nice transition of entering safe Zone smoothly with a time good and now we'll do exactly the same but the opposite so I will create another animation which will be basically exit go and select the track here and then it will just put the first key frame at one and at 1. five we will set this to be at zero and then add a key frame and now with that said there we go it you know disappears cool so now the only thing we need to do is go ahead and make sure that by default yeah it is set to zero so it's not visible and then on the graph delete all this and create two custom events the first custom event which will be enter and sorry we're going to name it the same as the animation so enter animation and we'll just get the enter animation and just say play animation and with that said you'll just play the enter animation and then we'll go ahead and just create another custom event which will be exit and go exit animation and then we'll just go ahead and get the exit uh animation component itself and do a play animation node and with that said we're good to go we can now save close go to save zone and right after we add it to the viewport we can just do a play enter animation all right so now we need to do exactly the same but when we exit so let's go to trigger go down to the you know events and on the end overlap we will do exactly the same for the condition of checking if it's the player so it's copy paste remember to plug in the other actor and then with that said what we can do is go ahead and just get this widget and just do an is valid so we will only with the second one so we only continue if this widget exists okay so we can avoid errors just in case and then we'll just go ahead and SK this do a um what was it exit animation and then after a bit of delay we can go ahead and delete it in this case I think it was what 1.5 we said it uh yes 1.5 so put this at 1.5 and we will once again check if it's valid just in case because we we're leaving time in between and then we can just get it and do a remove from parent and this will basically completely remove the widget and now with that said we're good to go we can go inside boom entering safe Zone appears with this animation and then when we exit we exit with this fade out and we can go ahead and go in again and exit once again and once you're inside you can maybe activate a Boolean here and you can do things as recover health and all that stuff so that's it guys found this tutorial helpful I would really appreciate it you could like video And subscribe to my channel lots of un5 and tutorial so check them out remember I have full access to the pro files through patre or YouTube members follow me on my socials join my disc server and now yes we said bye [Music] bye
Info
Channel: Gorka Games
Views: 2,973
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5 safe zone, tutorial, quixel, megascans, unreal engine safe zone, safe area in unreal engine 5, ue5 safe warning, safe message tutorial, widget danger, unreal engine 5 how to safe area message, unreal engine 5 safe area trigger, unreal engine 5 trigger safe area
Id: Q8xZbBnS0n8
Channel Id: undefined
Length: 8min 18sec (498 seconds)
Published: Tue Feb 27 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.