How To Make A Jumpscare | Ghost Running With SFX - Unreal Engine 5 Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys and welcome back to another unranging 5 tutorial so in today's video what we're going to be going over is creating a jump scare inside of Unreal Engine 5. now this is very similar to one I did a while ago if I mentioned four and by while I mean like a year or two ago but it's pretty much recreating that but making it a little bit more efficient and obviously in on version 5 now so let me hit play and shoot we're gonna make today so if we get into the game you can see if we can walk around like so I've got it in first person and if I want to walk forwards we're going to have a jump scare sound effect and a ghost or a character run from one side of the hallway to the other and obviously if we go and check where they went they're not going to be here anymore so this is a pretty typical jump scare you get in games now obviously my hot Corridor is pretty wide you can obviously change this completely how you want so you can make this narrower you can make the player be closer before it happens you can make them run faster you can make them look different have a different sound all that great stuff you can do that it's very very easy to customize and change for what you want but this is probably going over and creating today so without further Ado level delete this code and I'll show you how I've done it so the first thing we want to do if we want to actually create our AI which we're going to use so again this might be a ghost it might be a zombie whatever it is for you that you want your play to be jump scared by we're gonna set that up so I've already got my mesh and animations for this so I've just got something off of mixmode.com great free website for you get free characters animations and I'll leave a link in the description down below and on screen now to my video on how to use mix mode with Unreal Engine 5. so once we've got our character all imported we want to actually create the blueprint for it now you might already have this if you do perfect use that if you don't I'm going to create one now so we're going to right click create a blueprint class creating a character blueprint and I'm going to name this one zombie BP name this whatever you like but that's what I'm going with in here I'm not going to do a lot at all I'm going to select my mesh and give it these correct skeleton mesh which I want move it down into the correct place and then for me I'm also going to rotate it 90 degrees to the right like that just because the animation I'm using I need it to be facing that direction and now because this is the only place I'm using this blueprint this zombie I'm not going to be using anywhere else in the level it's just for this jump scare I don't need to set up an animation blueprint because the only time the player is going to see this is when it's running so I don't need an idle I don't need a walk I don't need to transition between them the player is only going to see them running so what we can do is instead of use animation blueprint we can use animation assets and just give it a run animation here that just makes it a lot more efficient and a little easier for us to use as we go again we don't need all that extra steps in there so we're going to compile and save that that's now the visuals of my zombie setup but obviously also wanting to be able to run so we're going to go to the event graph delete these three nodes not like that sorry we want to delete these three notes right click and add a custom event naming this one simply run or trigger jump scare or whatever it is that makes noise sense for you on this we're going to add an input node naming this location or go to or run to whatever makes sense for you again and I'm going to set this to be a vector now you can either have this as a vector or an act of reference the difference being a vector means you're going to be inputting an actual location value and act reference means you're going to be going to a certain blueprint whichever makes the most sense for you do that I prefer to do a vector because then even if I want to do a reference to a blueprint which I am going to do later I can still just get the location of that and input in here so it just gives me a little bit more flexibility after this I'm going to get AI move 2 like so we want the block underneath it with the kind of white block icon there and then the pawn is going to be get a reference to self the destination is going to be our location from our run custom event there and that's all we need to do to actually move it for me as well I also want this to be destroyed after we've gotten there so when the player then goes to investigate where they went the AI isn't there so on success what we're going to do is destroy actor like so and we will compile and save that like this that is all we need to do inside of our AI blueprint so let's close this like so and then I'm going to place it in my level so again for me I want it to be running across the end of the hallway here so I'm just going to place them in here just outside the player but close enough so they're going to instantly run out in front of the corridor now I've noticed I've actually rotated this the wrong way so let me just open this up go to my viewport and then rotate him so he's facing this way again it's just the animation I've got I want to be facing a certain direction as you can see like so actually no I think I did have it right I just had that bit located the wrong way so very sorry about that let me rotate him all the way back around I just had the actual blueprint rotated wrong so again my apologies there we go that's a lot better so as it's going to be running across you'll notice his animation is facing the player like so again I think maybe there or just there it's going to be fine just outside the player so when they come up he's then going to run out like so now this is fine for me because the player isn't going to be able to get into this room or any or anywhere around here to be able to see the AI before this jump scare is triggered if the player can do that for you then what you might want to do is spawn in the AI here instead of always having him here so where so later on when I trigger it and I make him run you can also do spawn actor and then make him run so that's another way around doing it the next step we want to take is we want to define the end location for where the AI is running so I want that to be again just over here now what I could do is just get a location of this so let's say I want this light I can get the location and just write that in straight away or what I'm going to do just make it more easy and more efficient for us is we're going to create another blueprint so in our content browser we're going to right click create blueprint class create an actor and I'm going to name this jump scare endpoints VP like so opening it up straight away and the only thing I'm going to add in here is simply an arrow and we're going to rotate that so it's facing up like so maybe increase the size a little bit to make it two instead of one we'll compile save and close that again we only need this to be a reference to a point in the world we don't need this to do anything else so now let's drag and drop this into a level and you can see we have this here and also I should mention arrows don't show in game by default so the player is not going to know this is here at all and the reason why I want to do an arrow is because you can see we can now just simply and easily move this and this is going to change where the AI is running too so if we wanted we can move all the way down here so the AI is going to run all the way around this corner if we wanted I don't want that so I'm just going to leave it here again this means we can immediately move it like this and that will then update in the code automatically for us so once we've got that done we're going to save this the next thing you want to do is you want to add in a Naf mesh bounce so the AI can actually run here so we go to the add up at the top go to volumes and then we want to get enough mesh bounce volume and just scale this up to the size you need you can make this cover your whole level if you want but for me the AI is only going to be able to go here so this is the only place I need it to be if we press P it should be green where the AI can move so I can see that this is going to be perfectly fine for me everywhere the AI needs to be is covered in green with a little bit of leeway room as well we don't need it but it's there anyway I'll press P again to talk about off now we want to start working on actually triggering this so what we're going to do is go back up to the ad at the top go to basic and we want to get a trigger box like so and this is how we're actually going to trigger the jump scare so I'm going to scale this up to this size we want I'm just going to cover the entire hallway of the corridor that we have here like so so the player has to go through it so again this basically means if the player enters this box trigger we're going to start the jump scare so there's no way for the player to get around this for me and I'm going to move this back a little bit here so again once the player entered this area the jump scare is going to start so I think here it's going to be fine it means once they get here the jump scale will start and again also we can just move this about and it will change where it starts so we can then just mess about with it and get the perfect values for us with this still selected what we're going to do is go and open the level blueprint up the top here right click inside the level blueprint and we're going to get begin overlap so we have add on active begin overlap for our Collision box we just created here out of other actor what I'm going to do is cast to our character blueprint which for me is BP third person character and now the reason why I'm doing that is just so it's only triggered by the player if another AI that I have in my level for example maybe I have a friendly AI if they walk into this it's not going to trigger for them it will only trigger for the player then after this what I'm going to do is get actor of class not get all actors of class just get actor of class so singular and we're going to get our zombie BP in here or the AI whatever you named it now the difference between this and get all axes of class is this will always just get the first actor of this class in the world now since I only have one in a level this is perfectly fine for me if you have more than one you will probably want to get all access of class and then actually run a search to find the correct one for you but I imagine you'll probably just have this one here out of the return value of this we want to get run which is the custom event we created earlier so if you gave it a different name you want to just call that there like so and you'll notice we now have this location here I'm going to move this out and then before this so the execution of get out of class we're then going to get actor of class once again this time it's going to be the jump scare endpoint BP recovery of this will be get actor location and this location is going to go into the location of the Run customer event we have here so it's going to run to the end of our jump scare point that we've already set up so this is now going to make our AI run what I'm also going to do is after this is play sound now you can do either 2D or at location I'm doing 2D just because I want the sound to be everywhere but you can do at location as well if you wanted to just be in a specific place now the sound I'm using is just a quick jump scare sound effect I got off of freesound.org which I'll leave in the description down below and you can hear it here so I'm going to select that press this arrow on the play sound 2D to use current assets we'll compile save and this should now be the code done and working perfectly for us so let's hit play and test this out if it's a walk forward you can see once we get to a certain point we're going to get the sound effect and the AI is going to run across like so now that seemed a little bit slow for me so what I'm going to do is speed up the AI so let's open up our zombie BP once again select the character movement and search for Max walk speed and I'm going to double this so change the max block speed from 600 to 1200 and that should now be a little bit better for me I think so let's test this out again we'll see that's now a lot better for me it's going to run across really fast that's maybe a little bit too fast so you might want to slow it down a bit as well if you want I'm not going to get too finicky with it because again I've shown you what it is that you can do this doesn't need to look perfect for me again you can then really mess about with it to get the perfect values which you want but I think that bit of this video as we've done everything we want to do what we've done is we've set up this jump scare which when we walk to the wall towards the end of a corridor an AI is going to spawn in run across the end of the hallway scare the player and play a nice sound effect as well and you can obviously see it gets destroyed at the end so if the player goes to investigate the AI is not here anymore so thanks so much for watching this video I hope you enjoyed it and I hope you found it helpful and if you did make sure to like subscribe down below so thanks so much for watching and I'll see you in the next one [Music] foreign [Music]
Info
Channel: Matt Aspland
Views: 16,154
Rating: undefined out of 5
Keywords: ue4, unreal engine 4, unreal engine, tutorial, ue4 tutorial, unreal engine 4 tutorial, how to make a game, how to, blender, unity, games design, ue5, unreal engine 5, unreal engine 5 tutorial, ue5 tutorial, horror, scary, game, scp, pt, p.t, jump scare, jumpscare, jumpscares, ghost, ghosts, girl, playing, running, run, through, corridor, infront, in front, of, player, sfx, sound, effect, effects, noise, with, box trigger, play, location, easy, quick, ue5 jumpscare, ue5 horror, horror game, resident evil
Id: Nb6obyNtUNU
Channel Id: undefined
Length: 11min 51sec (711 seconds)
Published: Mon Oct 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.