How to Make a First Person Shooter Game in Unreal Engine 5 - Full Beginner Course

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new unre engine 5 tutorial today I am going to show on how to create a complete first person shooter game it will cover all the things that you need and remember that you can get the private files through my patreon and YouTube members so Link in the description now just in case you are interested I do also have a full third person shooter tutorial so I will be linking it in the description all right it's going to be very easy view to follow so let's get started so the first thing that we have to do is create a new umbre project in my case I am going to be using the latest version 5.3.1 and I do recommend that you use the same version as me or above in this case we are going to be choosing the firsters template as we will already have some of the controls done we are going to be choosing blueprints you can select your target platform my case it will be desktop your quality preset and then we can enable start content or not in this case we will not really need it so we can use disable it and then rate tracing B depends on your Hardware then go ahead and specify a project location your PC and then let's go ahead and Ed put in a name which in my case will be first person shooter all right so now we can go ahead and hit create okay so the project has been created as you can see now I think that I always like to have is my content browser right at the bottom so just in case you don't have that what you can do is go up into window content browser select your content browser and then just drag it and unrate at the button okay so if we press play as you can see we already have a functional first person character that we can just walk around and we can pick a gun and shoot now we will change all of this okay so the only thing that we will keep is the basic character controls but all the shooting guns and Etc will be handled by us so the first thing going to do is change a bit the character controller to enhance it okay in my case what I'm going to do is go into the first person folder Blueprints and now we can see our first person character blueprint so now if we double click this to open this up you can see in the viewport we have our components such as the camera the arms and so on so what I'm going to do is select the first person mesh and detach it from the first person camera and that's because our arm will be separate so now what I'm going to do is select the capsule component and add a component called the spring arm now normally we use the spring arm to touch the camera at the end of this spring arm but in this case it will be a bit different so let's rename this to be the arms spring arm and now we're going to get the mesh which is the other mesh the first person mesh I'm going to rename this to just be the arms and attach it to be in the spring arm now the spring arm will have a arm length of zero so there will be no separation now you're probably wondering why have I added the arms into a spring arm it makes no sense well the thing is that if we go to details and search for lag we can enable one thing which is called the camera rotation lag and what this will do is add some smoothing when we turn the camera and we are we want to use this because I want to create a style of body cam game approach where it will feel very smoothly and it will feel like the arms are slightly separated from the camera so in the camera rotation lag I can put something as 17 and you will see that now when I press play and I manage to see my arms which is hard they will be a bit separated now don't worry we'll turn this init better any a second but another thing that I want to do is basically change the animations of this arm to be holding a weapon and of course also attach the camera into the player's head which will need to add a imaginary character so it will create this realistic head movement as we move so let's go ahead and do that okay so let's import the arm animations which I will be linking in the description so let's go into the first person orange folder animations and now what we can do is import the animations that I will be leaving the description which will be used two will be basically a pistol uh walk forward and an idle so now let's drag them in into this folder and very important let's select the SK mannequin arms skeleton okay now we can say import all and now you see that we have some warning it's okay we'll go down and we have them here so we double click on this you're going see the idle animation and also the walk forward animation great now what we need to do is basically create an animation blend space so we can transition from this two animations depending on the speed let's right click go into animation Legacy and let's create a bland space 1D in this case let's select the arms and let's go ahead and call this the bars blend space 1D and let's open this up in this case let's go to the horizontal axis and put this to be the speed the minimum speed will be zero and the maximum in this case let's put something as 400 okay so basically a BL place as I mentioned before will allow us to transition transition from one animation into another depending on a value which in this case will be the player speed so I can just go here and search for the idle animation which will be the mm pistol the one that we imported and drag it on to the left and then I can get the walk forward and just go ahead and drag it all the way to the right so now if I hold control and move this around the timeline as the speed increases my character will be walking great so now what we can do is close this and create a new animation blueprint right click animation blueprint let's select once again the arm skeleton crate and let's call this something as abore arms and let's open this up okay so now what we can do is get the arme Spen space that we have just created and just attach it into the output post if we compile right now the speed is zero and then if we go ahead and increase this to 400 manually and compile it will be walking so basically we have to change this variable depending on the player speed in the game now don't worry about the fingers uh we'll Tune In Tune in them a bit later but they will not be really visible from the players perspective because they it will have a pistol okay it will be kind of hidden so don't worry about that all right so let's go ahead and right click and promote this to variable so we have it as a variable and now we can go into the bang graph and in the update we can just get our owner and you get the velocity of this owner and now this will be a vector but this safe float so we can use this handy node which is the vector length which will convert the vector into float and now we can just put the speed to beat this so on every frame it will be getting the speed from our actor which will be the player okay so now yes we can go back into our arms and put in the new animation blueprint which is AP arms now as you can see it's there now the rotation will be a bit messed up and so one don't worry let's just go ahead and reposition this this so rotate this 90° put it a bit down and so on let's go ahe and do so and a bit up and basically I have to be a bit more in front because it will be more visible to the player so now if I press play you can see that they're there and I can move and they have a nice rotation lag as you can see when I had it's a nice interpolation now you can see the like I said the fingers are messed up but don't worry they will not be very visible with the pistol but basically we have those things going on so now we have the player arms set up which is pretty nice okay so let's go ahead and add the player pistol so in my case again I will be linking it in the description this one is from ayra so we can just get the folder and just drag it into the haunted browser which will contain the fbx the animation and of course the textures let's close this let's go ahead and click reset to default just in case make sure everything is by default but make sure to also check import animations because there's a single little fire animation let's say import all now wait a few seconds and they will say that there's a fpx that failed it's okay no worry go back here but we have everything set up with also the the the pistol animation which would not really work but it's okay because it will not really be visible okay so now what we can do is wait a few seconds there we go and we need to apply those textures into the material so let's double click to open this up hold control space to open up the content browser go into the pistol folder and now let's get the textures in this case this black and white one which is the D will be our base color so let's plug that there and delete the other one from our RGB then let's open this once again with control space and we can drag in the normal map into the normal which will add some bumps and so one now if I apply go back into the SK uh mesh we can see now has the materials great so let's save everything with control shift s very important and let's go ahead and close all this and now what I want to do is open up the arms and add a new socket which will be a position in our bones where we will have our pistol so let's go into the first person arms folder let's go into character mesh and open up the skeleton okay now in this case what we're going to do is preview and animation in this case the idle will work because we just going to ahead and pop it on there so it will be this one and then P to Idol a this that's the one that we imported and now what we need to do is go and anchor into the right hand so be there so again don't worry about the fingers it will not really be visible from a player perspective as much so let's go down find the hand R bone right clicking it and now we can add each socket so now we can we name this socket as RH of right hand and Pistol and now we can move this socket around and that will be the position that will anchor our pistol now yes for some guidance what we can do is right click on this socket go down into preview asset and just add a pistol model and now yes we can start to rotate this and put it in place so let's go ahead and also just uh pause this so this a beit easier and then let move move it now again all the fingers are messed up but for our player perspective not be really visible okay so we have to play around with this values okay and positioning so first of all let me try this out okay I think that I have to rotate it like this but let me just wait a few seconds to try it in game so now we have that socket created and don't worry because the pistol will not appear if I now for example press play the pistol is not there and that's because we have only created the empty socket but this static mesh is only a preview okay so what we have to do is go into the first person character and add it now in this case we have to add this pistol which I call this static mesh but it's a skeleton mesh because it has bones okay and we're going to go into the first person blueprint go inside of the arms because this is the thing that will contain of course our socket and now we can add a skeleton mesh the pistol which will have it selected that's why it already add it if not you can just add an empty stic mesh and you search the pistol here and now we have here the parent socket option so we can go and find our RH pistol socket that we created you can see it will be offset that's because we have to reset the location and rotation and now yes is there so very important let's make sure that it has no collisions on so it will be not affecting like the player capsule Collis and so on okay so now if I press play we can see it there in action and it looks great now we have to rotate it a bit to the left as you can see so no problem we here and rotate it slightly into the left bit so it be more Center then we can tune it in a bit more as we go but it's looking great as you can see so now we have the pistol mounted in the player's arms so that's looking great okay so now let's implement the player head bobing so right now when we move of course we have the animation of the you know hands moving around as we walk but the camera is completely still and if we want a very realistic and cool approach we can move slightly the camera ahead as we move and the easiest way and more accurate way to do so is to basically anchor it into an act two player head that is moving right so what I am going to do is go ahead and import the third person template which will contain the Manny skeleton which is a full mannequin which we can use and an walking animation so we can just go into add feature or content pack blueprint and select the third person template we going to say add to project and don't worry now we'll have to delete some folders that we will not need of course so there we go the first thing that we're going to be deleting is this third person folder okay so let's go ahead and select it third person delete because we don't need all of that okay so just delete it there we go and now we should be good because if we go to characters mannequins and we go to animations and for example man because we have two types of characters as you may know we have now the idle and walk animations that we will basically go ahead and use in Z one so we're going to do is on here right click animation and create a new Legacy blend space 1D in this case let's select the SK mannequin not the arms okay very important now it has to be just the mannequin the hole itself now let's go ahead and rename this to you Beed the body BL space 1D open this up and once again we have to change the parameters so the speed will be called uh like that and then the maximum will be I think we set it to 400 and now we can insert the idle animation which is the m Idol or MF Idol whatever you prefer they're very similar and then also the walk forward animation in this case this one the forward okay if I hold control move this around the timeline you can see that as the speed increases the character will basically move great so quickly create an animation blueprint for it go to animation blueprint select the SK mannequin for the whole body create ABP uncore body let's open this up and now once again is exactly the same as you well we did for the arms okay so if you want to pause the video as part of a challenge and do it yourself go ahead and we'll cover this in a few seconds okay so what basically we have to do is get the body plan space okay and just plug it in into the result now will basically be animating but we have to update this variable right so let's right click and convert this to a parameter or in this case a variable and let's go to the event graph and here we can get the owner in the update and just get the velocity as we did before and then we can use the vector length node to convert this into a nice float and we can just get the speed and you set it on here on the update so it's exactly the same as we did with the arms okay so if you managed to do this challenge good job very proud of you and if not don't worry we just covered it so hopefully it will be clear okay so now we can go ahead and close this and we're going to go into the first person character blueprint okay into the viewport and now what we need to do is just going to just you know enroll this let's select this mesh and I am going to be adding the Manny okay which is going to be the man simpol now we have it here let's select the body animations and let's just rotate this minus 0° over here so that will be perfectly in position I think that this is a bit offset maybe I don't know why there's minus 55 here oh because it's turned back oh that's good okay I want actually be a bit turned back and then uh what I want to do is maybe a bit forward and I'm going to get the first person camera pop it inside of the mes and then change the parent socket to be the head now you will see that it will be mounted into the player's head let's go ahead and reset the position and basically I have to rotate this around 90° like this and another 90° like this will be facing the correct way and now basically I just have to put it a bit forward and then we can go ahead and press play to test things out as you can see now when I move the camera also Bops up and down which creates a more realistic movement and it's so cool and I will see my body of course that's pretty cool but of course it will be separated from the arms so don't worry what we can do is kind of merge them together in a way but we will not really create a realistic result so really is just uh kind of maybe limiting the camera angle okay as is what we're going to do okay we're going to go into search of a deal of you know merging the arms with the body okay not worry about that you can maybe put them you know uh more backwards but it's okay for me okay so now we have that set up so our camera movement will be way more realistic okay so now let's go ahead and Implement shooting so when we go ahead and left click we'll basically do a line Trace which is like an invisible brightcast from our tip of our gun into our destination where we're looking into and we'll apply damage into whatever is there so let's go and create a new input so let's go into the first person folder input actions and we already have an a um I a shoot okay in this case it will just basically be a digital bu so we have the action created which came with the third person template but we have to add it to the collection so let's go into the default and now what we can do is add a new mapping and this will be the shoot and now we can specify what key we want so we can click this button and then just press the left Mouse button or or manually search it but it's easier to go ahead and just click it okay so now if we go back to the first person Rector go to the V graph and go bit down we can right click and then just search for I aore shoot and now when we press this on the started we can do something in this case we are going to be doing a light Trace by Channel okay so we detect whatever it would do okay so we will go from one starting point into an end point the starting point will be the pistol position now in this case let's create a socket for it okay so what we can do go to the pistol enter into the skeleton and what're going to do is basically create a new socket so we're going to go and select the in this case I think we can select the grip or yeah let's select the grip add a new socket and let's rename this to be the uh muzzle so now we can just go ahead and move this into the front front and it will appear the array on there okay so that will be good we can now close it and now just go ahead and you say get socket bone name or socket location rotation whatever in this case we want to get the transform because if we right click and split it we now have the uh location and rotation in this case the location will be that one because that's where we want to go and in this case it will be the RTS parent bone space because we want to get where our parent bone is looking and we want to also put the musle name this has to be exactly the same as you named the socket so that's very important okay so now the end point will be where we are looking forward so for that we can just get the forward vector and then we want to times this and that's because we want to set the distance so we can just right click convert this to float and this will be how far away we want our Bullet To Go in this case around maybe 5,000 work for me now we can go ahead get the location and add this Vector with this one and I'll give us our end point great so now what we can do is just put this for duration to preview it so for now press play and I shoot you can see that nothing will happen okay and you're probably wondering wait what is happened well if we go first of all let's make sure this is triggering so what we can do is add a print if I press play so can see it is indeed printing hello at the top left corner so that is working correctly so now we can plug that back there so basically the problem is with the transforms that's being created in another place so we can basically play with different um transform spaces to get what we want you can see now we got the line trait but of course it's appearing in another part world so not that's not the one that we want let's try with world and okay we are getting something it's a bit better but it's still going a bit where it wants to right um but that's basically working because actually the mle flash is you know uh looking a bit up the point so actually this is the the point that we want which is working okay so this is working but the thing is that the because the pistol is bit tilted it's going upwards so what I am going to do is actually change this a bit okay and it's basically just um like put it to be from our camera perspective because that will save issues so I know that we did all this don't worry let's disconnect it and let's put it for later because we will use it anyway for our mle flash okay not the calculations but the location and rotation itself so now here what we're going to do instead is a bit simpler just get the first person camera and get the world transform and now can right click split this will be the starting location and the rotation will in this case we can go ahead and just copy this three things actually going to crl X and mop them and paste them because it's the same we're going to get the forward Vector of our camera so where we are looking at and then I'm going to be adding this into here and that will be the end point and now you'll see that it will go into exactly what we're looking for okay it will not really come up from the pistol um point but because it's imp pable it will do the job okay so now that's done and what we can do is just make sure that if we have HED something we'll go ahead and break this and now we have all the details about the object that we have hidden in this case we want to apply damage so real engine has an implemented damage system into the engine which is great so we can just get the hit actor so the actor that we have basically detected and then just apply damage there's already a node that will do this in this case we can apply whatever damage we want so let's just right click create a new variable and this will be the pistol damage great so now this pistol damage if we compare we can repl something for example maybe 15 you can play around with values as you prefer so now when we you know do something it will apply damage but of course the actors they're B basically empty side meses so they will not do anything but when we have our a i it will actually do some damage into them so that's set up now we can basically shoot some right uh line traces okay so let's add the mle flash effect in this case we are going to be adding this Infinity Blade effects asset which is from epic games themselves and it is completely free in the marketplace so I'll will be linking it below so what we have to do is basically just basically download it and then just add it into the project in this case let's search for our first person shooter and click act to project and now we'll just wait a few seconds until this completes okay so it has just finished importing and basically say complete and now it says again add to PR so now we can just close the epic games launcher and we can see new folder called Infinity Blade effects we go ahead and enter in this folder and search for mle Flash you can that we have a few of them in this case let's use this one which I think looks pretty good so what we need to do is go into the first person character blueprint and right after we shoot our line trays we will basically apply the muscle flash okay so this will be independent from if we hit an object or not so actually let's create a sequence here this will allow us to have different pins from one Connection in this case in here we want to basically uh put a different emitter so we can say a spawn emitter at location or attached in this case uh I think that because it will be very quick we can just handle it by doing a location so let's try that out so it will basically spawn a system animator at light location now in this case we want to get our mle flash um socket that's why we didn't deleted it and now we're can apply the location here and the rotation here and put this to be out to release on the pooling so it'll be like more optimized so now we can search for The mle Flash and there will be this chicken master I don't know why it's called Master but it looks pretty cool and now you see that when we basically shoot uh the M flash will appear it's basically load oh my God we have feathers okay I think it was the other one we we have feathers going out okay I think it was the other one in that case the um backpack it has to be backpack in that case see yeah that's a bit better well I mean there's a ray shooting towards us I don't know if because it's um incorrect uh in the positioning let's let's see the uh the fireball how it looks um yeah I think the one I mean the chicken looks pretty cool but of course there's like feathers going out but we can edit the feathers um but I think the thing is that they're coming towards me right the rotation is incorrect In this case I believe so so we can just go to rotation and basically use just split the rotation into individual axis get the set which is the Y uh and just basically add uh basically 180 and this should in theory and disconnect the other ones like they are rotated to look the other way um let's test this out uh okay so now it's actually fighting okay okay so it was correct sorry about that um so let's Rec combine them Rec combine the rotation plug it in and let's enter into this chicken master okay okay and basically you're going to um just duplicate this and this will be the chicken master 2 let's um plug this one in and then let's just edit it real quick now I have to mention this and this is not using [ __ ] which is the new real engine uh particle system this is using Cascade which is the old one and I know it is a bummer but it is what it is uh it's a simple particle okay so no worries in this case we have here the um particle okay uh of the feathers so as you can see we can just disable it here and now it will disappear so just click this button and with that we can now shoot and we will not have any feathers going out and now let's change a bit the scale so maybe around2 because that is absolutely massive for a pistol and now is way better as you can see we shoot and it looks much better now this is what I was talking about you can see I was deciding between um if to put it as attached or at location if we are still it looks pretty cool but if we are moving because it is not attached to the gun it goes backwards and it does look very bad so let's change this from being spawn emitter allocation to attached so let's right click spawn emitter attached and it will be the same pretty much stuff let's just hold control Mo that down and let's apply the musle flash of the chicken uh two which is that one and now we are going to just attach it into a specific component which will be directly the pistol okay and then we can just put the muscle to be the point that we want okay and the location rotation should in theory stay the same then this um could stay the same maybe it's SP it's an out to release uh so let's test this out so if I now shoot there we go so now actually stays which is a bit nicer and let's change the scale once again to be 22 and2 and now it does go ahead and shoot correctly and we move and it stays a bit more there which looks way nicer so let's delete this one put it here and we actually don't need that transform so there we go okay so now we have that dirt let's put it here and everything looks great so now we are basically shooting and so on so that's great we have the mcle flash added okay so let's go ahead and add a small camera shake when we shoot to make a bit more of a you know feeling that we actually shooting so let's go ahead and just right click create a new folder to just call it BL blueprints uh in general and in this case in here we are going to be creating a new blueprint class and let's expand this and just basically uh just search for camera shake and let's use this Legacy camera Shake let's call this BP score um shoot come Shake let's open this up and now we can change a bit the settings about this camera shakes in this case will be like25 maybe um the rotation will be uh with maybe an amplitude of one frequency of two uh we can play around okay okay and we can just basically set some settings we can go back to the first person and use um play camera shake and select the one that we just created which is the shoot and the IP Center will be the get actor location because it's where we are shooting at our location and now the outer radius how far away will go let's put something as 3,000 okay doesn't really matter it will be a single player you can see now when we shoot we have a very small camera Shake looks pretty cool now maybe we have to make a bit faster so maybe 0.1 will be a bit more accurate let's see yeah I think that's a bit better you can see when we shoot there a small camera shake it looks pretty cool and yeah I love it we can maybe add some in the not only rotation but also location but I think that it will be enough okay um maybe .17 it look a bit better you're going to play around with the values to get what you want but I think .17 looks really good honestly wow cool stuff all right so camera Shake okay so let's go ahead and add some sound in this case some footsteps and then a fire sound effect so let's go to our content browser just right click and create a new folder let's go this audio it is always very important to have everything organized and you know folders and so on and not have everything is scattered everywhere okay so let's enter in our audio folder and let's import our two sounds in my case I am going to be leaving the description let's go ahead and just WR the two into there and now we have them here so we have a pie of file and then a foot step so what I am going to do is basically change the pitch every time that we play them because if not they will sound very repetitive and this is a very good trick because I will not need 20 different sound files with different you know alterations and Pitch uh when I can do it in real time when we play it so for that what I am going to do is right click go into audio and create a meta sound let's call this mscore footstep let's begin with footstep and let's open this up so now here what I can do is that when we play the sound I can play a wave player in this case mono and it will be that clip so right now until here we're just basically playing our first step like normal like if we were just to play from the audio source and now we can go ahead just plug the output into the output and when it's onfinish into the output to tell our meta sound that the sound has finished if I press play Everything is normal but what I can do is get the pitch and add a random float and connect this into next and this into next so now each time that we played we can add a random range of this in this case around minus three and three so now every time that I play it it will sound slightly different which will make it more realistic less repetitive and very simple without having 25 different audio files which is very very nice now maybe you don't notice it a lot so you can play with the ranges to get which one but it has to be very subtle now let's duplicate this and do the same but with the uh pistol fire so pistol fire open this up and the only thing I have to change here is the wave s said to be of course the pistol fire and now will be the same as you can see it slightly changes to be more realistic without having 20 different Audi files like I just mentioned okay so now we have to play that pistol fire okay so what I am going to do is go to the um first person uh blueprint and now here when we play the camera sh again so one I am also going ahead and just play a sound at location and it will be that mscore uh pistol far now remember to use the meta sound that we created not the original sound because I'm not able to have the pitch alteration that we just added so let's get the actual location because that will be where the sound is you know going to appear in this case and with that said we can just go ahead and test this out as you can see that that is literally great that works so well and then we will add the footsteps so in my case I am going to be adding the Footsteps in the player's uh body because well it's where we have the legs right so it makes sense so let's go to the um charactera folder mannequins animations Manny now very important you have to use the ones that you use in the body blend space which in my case it is the mm idle and walk forward okay very important has to be those so in my case I am using the um mm walk forward and of course the idle is still so we will not need to add footsteps on that only in the walk forward so in this case real engine has already marked us where we you know have each footstep so that's great let's add a new track which will be sound and we can just put our cursor on top of the part where our feet touches the ground which again it has been marked by epic games that's very good just right click exactly that point add a notify of play sound and now we can select this in the details we can search for our MS footstep and that's done so now we can select this press contrl C go to the next one click on here and contrl V to paste it very important you have to click on the place that you want to put it okay so now we are pasting this and now if we press play you can see it will be playing and I'm going to do the same which is great cool all right so that is working I am also going to go ahead and decrease a bit the max walk speed to around 400 where we set it on the blend space so it'll be a bit more accurate there we go that's a bit better that's so cool I love how it is looking okay so now what we have to do is go ahead and set up a dummy so we can apply damage into it let's go ahead and do so so let's go into our blueprint folder and let's create this dummy blueprint it's right click blueprint class select in this case C because it will already have a mesh and a capsule cator that we can use and let's name this bpor dummy so we continue off the logic to apply damage and then later on we will turn this dummy into the AI that will basically be your energy so what we are going to do is select the mesh and use apply in this case for testing the SK Man Simple or queen simple whatever you prefer let's put the location to be at - 89 on the Z XIs and - 90 on the Z XIs once again the rotation so is uh perfectly placed let's put the name class to be the body you said we just have the auto animation so that's great and then what we're going to do is go to the event graph because we need to add some things up here you remember that in the firsters character blueprint we had this very handy node which is inside of real which is the apply damage well now in the dummy what I can do is add the event any damage so this will be triggered when we receive damage so in this case if the actor that have hit it with line tra and I have apply damage is the dummy he will receive this and it will do whatever is here in this case we will have some health so let's create a new variable name it health and let's change it to be a float because it has to be some numbers with decimals right let's put some initial Health very important so let's press compile and let's put something as maybe I don't know uh 30 right whatever you prefer and what I am going to do is get health and basically subtracted from whatever the damage is incoming because we have the input of what health it is incoming then I want to set it so I'm going to update the health variable with whatever the subtraction was and then I am going to do a check which is if this health is less or equal than zero if so I basically want to die well the AI wants to die so I'll get the mesh and set simulate physics what what they will do is basically go ahead and reile so it will basically set physics on all of his bones and just fall so very important let's let the mesh go down and the Collision presets has to be on custom and on CIS enabled it has to be Collis enabled query and physics so all of the bones will interact with each other if not it will be bucked okay so now in theory this should work if I put my dummy here sorry that's the third person character no no no it has to be the tmy there we go uh let's rotate this also we will not use this gun so let's delete it and now if I go here and shoot the dummy which don't worry I know that we are shooting in a different place from where our pistol is don't worry we'll fix that in a second nothing will actually happen it's because it is not Collision as you can see the rays are going through and colliding actually in the wall and this is because if we go into the first person character we're using here the visibility Trace Channel but in our Mage we have visibility set to ignore any dummy okay so make sure to click block and now yes we can basically hit our dummy we hit it to twice and he will rack out to the floor which looks amazing looks pretty cool honestly so now with that said everything should be done and uh looking great um cool so that's it um let's do one change I want to experiment with this and let put this spring arm to be basically inside of the third uh s the first person camera let me try this out because now um H do you guys think that this looks a bit better yeah I think that because now we can look up and down yeah um but with a bit of offset so maybe like um you know like this so it's more straight yeah I think that that looks way better yeah yeah yeah okay cool stuff okay so now that's better and actually the it will match a bit better what we are hitting so quick quickly let's add a simple Crosshair right so we know where we are aiming so for that let's go and just add a new inser user interface which be a widget and this will be a wbore HUD and on here what I'm going to do is add a canvas panel which will allow us to place things on the screen let's add an image let's just put it on the center let's put the position X and Y on z0 so it'll be in the center and alignment point5 .5 so now yes will be centered now let's put the size to be around 40 and 40 and now in the brush we're going to put an image in this case on real engine has this anchor which looks like a Crosser very ugly but it will do the job and of course we have to have this HUD to when we start the game Let's also just create a folder for UI and drag it inside move here very important so let's open up the uh first person character blueprint and in the begin play when the game starts let's add it we are going to be just um creating the uh widget create widget node I don't know how to type you see it's like there we go create widget finally and now we're going to add that HUD and add it into the player viewport and now yes as you can see we can see that Crosser and we'll basically shoot exactly where we're aiming which is nice now now the pistol kind of it's kind of in the way you know it's kind of in the way so we need to uh play a bit around with the oh my God where my viewport go uh viewport where is it um uh it's kind in the way so let's move it a bit um so my did my viewport just go uh window uh view part there we go didn't see it okay so uh let me move this here sorry about that and now can to get my arm spring arm and move it a bit more back let's see that's a bit better and that's a bit better and then I think it has to be a bit rotated downwards so let me change the snapping to a bit less let's put it a bit downwards and okay that is perfect great so if you want to copy exactly my positioning here are the values okay very important okay so that will be set for our damaging and the Crosser and it looks pretty cool there we go okay so now let's go ahead and add some party gos so when we hit the enemy so let's go into the first person character go to the V graph as you can see in here we have uh when we basically you know Collide uh with the actor so what we're going to do is basically spawn system at the location and I'm going to select this impact player effect I think was called like that um let me see layer oh sorry it is not system it is spawn emitter and this because very important when it is a Cascade which is the old system for Real where you using emter but when we use Niagra which is the new version of the particle systems in real it will be a system okay so be careful with that okay so now yes it will be impact player and I think it is fire week I think like this and now we can just pass this impact Point as the location rotation can stay the same and scale maybe like5 maybe that's a bit better and then pulling out to release so now in theory when I Collide we should have some po go going on which is hard to see I don't know if they're oh yeah so you can see that they're appearing um but the rotation has to be modified so we're going to get the normal and a make rot from X so it will always be looking at us and I think that will do the trick okay so yeah so it's you can see it's appearing but it's the same color so let me change this to be the impact player maybe instead of weak it will be uh medium that would be a bit better yeah it's a bit better and I want to change the color let's see if we can so let's search it okay here it is let's duplicate this to be yeah this one and it's very important with that new one selected let's uh anchor in there let's open this up and let's see so we have some things as the color that changes over lifetime but um yeah we're using those values because if you change this to red I mean it will change that but bright blood this is the thing M color editor um color over lifetime once again this points should be more reddish so we're changing to bit this to be more reddish but it's not very notable that's the thing um but yeah we're doing something I guess car of Lifetime uh now of course this Cascade the old un real particles system so I won't really recommend you to learn this so that's why I'm not really explaining stuff um but if it was the uh n don't worry that'll be a bit simpler but it's okay so that's a bit better they're basically you know adding some particles when we hit the guy and we can also add this one for example impact any enemy base so we can basically do both right um so now we can just plug that enemy base and we can just double click on this and plug it here and double click on this to make a reroute Noe and put on there and then that should be it so now we're putting two different particle effects and it looks way better so you can see also on the floor it looks crazy good which is cool another thing is that we're going to be disabling the the bug for the line trees because well we don't need anymore right already shooting like that it looks pretty damn good so cool stuff I like how this is um you know turning out so we have that um particle headit effects done all right so let's start to create the AI enemies so in this case we're going to do right click create a new folder call this Ai and let's enter into this folder and now what I want to do is just right click and go into the AI artificial intelligence section and let's create a Blackboard let's call this bore AI now this will basically contain a different uh variables that we can use to communicate between our Behavior trees and our blueprints so we'll see how we uh integrate it later on but let's go ahead and just create that and then also of course the behavior tree so let's go ahead and name this btor AI I name it AI because it's going to be basically pretty much generic right we are only going to have one type of enemy AI which will be or AI so that's why I name it like that okay so now what I want to do is create a blueprint class which will be the AI controller so let's search that and it will be AI controller this one selected BP _ aore controller so with that said let's open up the AI controller and on the event graph when the game starts at the begin play I want to run a behavior tree so this is very important let's select the behav tree and now we can close this now very important let's go into our blueprint folder and basically get our dummy drag get into the aii folder and say copy here so this will be our copy and let's rename this to be the BP AI so now in our blueprint for our AI I want to go to the class defaults and search for the AI parameters and now we can specify which AI controller class it will have in this case I want to add the one that we created which is bpor aore controller which will basically have the nodes which will execute the Behavior tree as we just added now very important now thing that I like to do is change this from out to possess AI to place in W to place in W or spawned just in case you spawn it and your AI will also work okay so now with that said let's go ahead and delete this dummy and drag in the real AI okay now it will still of course not move or anything so we need to add all these states so let's open up our uh not Blackboard but our Behavior tree and let's go ahead and make sure that it has assigned that Blackboard asset which it does because it's the only one created okay so now in here the behavor tree will go from uh uh up to down so basically downward and from left to right so with that we will create a selector and this selector will basically choose between different sequences in this case we want to have our first sequence which will be our Wonder sequence so we just Beed our AI just m around the level basically searching us and then we will basically have another sequence which will be the chase sequence where it will be chasing our player okay and the selector will you know choose which uh sequence to play so again the Wonder sequence because it is on the left it will have a higher priority and it will play first in this case what I want to do is create a new uh task so let's go up here just click this button and in our AI fold list right click create a new folder call this the tasks and then here let's we name this to be btor task uncore and then just wonder okay so here what I want to do is go to functions override and on the receive execute AI which is when the task is uh started right this is like the begin play of the task we want to move into a random location so we can use the AI move to node which comes with un real which is the second one and we can pass the control Pawn which is the the AI itself that's what it will move and then the destination well we can get the random point in the rable radius so we can just go ahead and just get the control pwn uh location and that will be where uh the origin will start right when where our AI is right now and with that said we can put how far away we want our AI to go in this case maybe like 5,000 uh will do the job on success we're going to play the Finish abort not the Finish execute node checked because it succeeded and on fail it will be the same but unchecked on success and now if we go here and add that Wonder task and then after this is completed wait like 2 seconds you can see that it will not move still and that's because we have to add a very important component to to our level which is under here quickly add to the pride volumes the nav mesh bounce volume so let's drag it into our level and let's make this uh with the loed uh go like 20 and if I press p as you can see everything that will be inside of this which right now is zero put it in 20 um oh my God this is very bugged okay let me just put this to zero locked 20 20 okay this bucking let's unlock and just put 20 20 so now it's filling the whole level and as you can see if I press p i can preview all of the paths that the AI can go so this is the way that a real engine will calculate all the possible uh paths where the AI can go so now as you can see it will move now it looked that it was going for me but it's actually just picking random Point wait in two seconds and going now there's a few things that we have to change it is moving very quick and rotating very harshly looks very bad so let's go go ahead and tune those things in so let's go into our BP aai in the AI folder where we have the mans one let's go and select the character movement component and change the walk speed to be around 350 so it's a bit less than our 400 walk speed of our player so we can run a bit faster than them and then let's go down and enable orent rotation to movement so he will basically move uh rotate into where he's looking now he's already doing that but in a very harsh way in this it will do it with a nice rotation rate which will do it smoothly and now we can go to defaults search for y and disable because this is the one that it was using and it's very harsh and now it's going to see it will be walking way slower and when he turns it will be smoother as you can see so now not like snapping so now it will look way nicer and that's it so now what we're going to do is add the ability of uh sensing for our enemy AI with sight so he can see us so for that let's open up our AI controller and let's add a new component which will be the um AI perception okay this AI perception will allow us to basically um add different senses in this case we want to add a sense which will be the site and we can change different options inside of it like the radius the loose height radius if you want to detect neutrals friends or enemies only um the point of view the angle and so on in this case we want to detect everything and this is because when we are in blueprints this AI perception kind of bug if we use this affiliation uh tax right um because this uh is really made for C++ so we are going to be detecting our player as an enemy by our own system okay so make sure to take take all of these all these three very important okay if not it can uh break and it probably will so make sure to take those three uh we can leave our dominant sense as none because we will only have one which is site and then we're going to leave this um uh values by default but we'll tune it in as we go okay so now we can go down and go into the On Target perception updated and that's basically when we detect a new Target in this case what I want to do is check that this actor has the tag player okay so make sure to go into our first person blueprint go to class default search for tag and add here the tag player very important and of course have to be exactly written the same so make sure that you don't do any mistakes so if that player has the tag um you know uh well that has the tag player we want to uh search it so in this case we want to get the black board which is like I mentioned before the thing that will have all the variables that will connect between our beavor tree and our Blueprints and we want to basically set a value as B so what we have to do now I'll explain what we're doing in a second but let's go into our AI folder and open up our uh Blackboard and let's create a new key which is basically a new variable so here in this case it will be a Boolean and it will be a sing player by default this will be false let's save and now we are going to be setting that variable as true because we are seeing the player now this is a bit different because for blackboards uh we cannot access individual variables like we do with a blueprint class we cannot go and set the is seen player variable it will not appear so instead we have this Universal type of variable node where we can just set it as a boo and in here we can just make a literal name node and we can set specifically the name which is this one so make sure it's copy in basic it has to be the same and now we can put this to true so instead of uh doing it individual we have this universal one which we can pass the name and now set that to true if you Mak sense so now that will be set to true so now we can go back to our Behavior tree save very important and what we can do is basically um make the chase sequence so let's create a new task from the blueprint BL and we can go to AI tasks BT uncore task uncore taste player and in this case once again it will be the receive execute AI That's like the begin play When the task is executed I want again to um use the AI move to node okay uh again it will be the control pawn and this time it will be to the um um get player character so it will directly go to the player character let's add some spacing as 120 and then on success it will be the uh finish execute okay and then on fail this will be disabled so now in here we can do the um Chase player Tas and basically it will never do it even though right now maybe it is seeing the player okay and um it would never go there and that's because we need a condition with our Blackboard key that we created so what we can do is hover on the uh CH sequence right click add a decorator and it will be a Blackboard decorator so we can access those variables in this case we want to check if the Blackboard key which is same player is set so it is true if so we want to go into here and observer aboard we want to be self so if this result changes we want to go out and in the selector we make again the decision and now in the Wonder sequence once again it will be with the black Port key but this time it will be again of course it's same player but if it's not set and this again will be self so we can go out of this sequence to check again so now we press play you can see now the player saw uh so the enemy saw the player and it's chasing me which is pretty cool and I I just literally abominated him now he's de so cool as you can see everything goes ahead and works in that sze which is pretty cool now let's W uh one more thing which is in the AI controller go to stimulus use this break node so we can split it and we're going to get successfully sensed and make this a branch to be true so we only continue off so it is true and if not we will set this to be false so we can lose um the player so with that now he should also be able to lose the player if he goes very far away okay so let's make that our AI can go ahead and attack us so let's import an attack animation in my case again I will be leaving it in the description so let's go into the character's folder mannequins animations and let me just drop it here okay because it will be more like Universal so in this case it will be this variable this variable this animation and it will be the push shop attack okay and we basically renamed it um directly but in the pack it will be one that is called push shove attack okay that's the one that you want so now we can extract this into the content browser and we can import this now very important in this case the skeleton will not be the SK mannequin for the unre engine 5 version it will be the SK mannequin skeleton for the old ue4 as because the animation is built for the old version let's say import and now we have it on here you can see this the tech animation um but it's with the old ue4 so we're going to create a new folder and just call this ue4 and drag it on here and because we imported the third person template we can simply right click and retarget this animation and we can select the ik [ __ ] of u4 to u5 and let's choose a location which will be the um characters manne animations retarget and now as you can see it is with the u5 skeleton and it works great so what I want to do is right click and create an name Montage because an name Montage will be able to be played at any time so now I'm going to go into the AI blueprint and basically we're going to create an interface so we can communicate from our task to our AI so let's right click go to animation uh sorry blueprint interface BPI AI in this case let's create a new function which will be automatically created let's rename this to be something as just attack we will not need any inputs or outputs so we can use compile save and close so now what we can do is go to ai go to class settings and go into um Implement interface and add our BPI AI as you can see now we have a new function which we can double click so whenever this is called we will do something here in this case we want to play a montage okay and it will be this first one okay now the second one it will be the first one because it's more complete we need to specify which mesh which will be this one and the Montage will be this one okay uh cool now we also have a rifle shoot Montage but that's for the old one so not uh just ignore that okay so now uh whenever this is C we will play the attack animation so we can test this if we go into the tasks we can open up our Chase player and when we uh basically arrive to our player we will play another attack on task so let's go into the weav tree new task blueprint base tasks btor task uncore and this will be attack this case we want the receive execute AI once again like when the task is executed this is what will happen we're going to get the control pawn and just check if it does implement the interface that we want which in this case is AI if it does we will basically go ahead and say to attack from the uh interface so now we don't specifically have to t uh cast to the AI uh blueprint we can just directly call the t t task which is cool all right so that it we can then use uh weight uh like maybe. 3 seconds right and then just finish the task finish execute it it's important to have the Finish execute because if not and this will be on false just in case we don't have the interface because if not it will never continue on in the B tree so now we need to add that into the um sequence so let's go ahead and add the tag right into the right after that one has been completed so now who will come and you can see that it will not do anything why well good question so let's just double check this uh so let's print here um if we have uh finished that task and we're executing this one as you can see it is printing hello top left of the screen so the thing can be that um it does not have that interface but let's double check it should now print here as you can see it's printing so it does have that interface so as you can see there's a great way to debug by using print and we go further in the chain in this case the attack let's just check here and make a print if it's receiving this and it is receiving this okay so in this case it is not playing the animation montage and why is this well it is a very simple and stupid thing let's go and open up the animation blueprint and now as you can see in the N graph we just have our blend space directly into the output post but the anim montages are actually played in a specific slot that we will need to add which is the default slot so all the animation montages will be played on this default slot and if we don't have that slot in our animation blueprint they will not play and as you can see that will be solved and actually it will be attacking us there we go cool stuff uh so that's it for the animation side now we need to do all the traces and damage so let's do all of our traces and damage for our AI to apply damage into our uh player so let's go into our AI folder open up our BP aai and on the play Montage let's go into the notifi begin and do a sphere trace for objects now first of all what is the not I begin well if we go into the Montage animation what we can do is specifically tell when we want to apply damage in this case we'll be kind of in this Frame when we are reaching with our hands so we can go into the notify stack and basically right click and add a notify Montage notify and now when this is triggered it will trigger this and that's the specific point what I want to do my sphere Trace to detect the play and use play damage great so we can close that down and on here we're using a sphere trace for objects instead of a line Trace by Channel why is this well first of all we do using a sphere train instead of a line Trace so it will be thicker so OB just be easier to hit the player and then we're using for objects instead of for trays um because we can just detect uh a type of object which will be Pawn so it will be easy it will just detect the player and that's it so we want to be the start position to just be the get actor location so where we are right now as simple as that and the end point where we want to get the actor rotation and we just want to basically get the forward Vector okay with that done I just want to do exactly the saying that we were doing at the start with other line trades which is multiply this right click to compare to a Float by how much we want forward let's put like 300 and let's add this two vectors and that will be our end point now very important because this is a sphere we want a radius let's put something as 25 let's see that's not too thick now we want some object types so we can make an array and specify that we want to search for pawns as our player is a pawn and then we can preview this so we can press play and we'll see that now it will create this line Trace which will detect the player as you can see it is very uh like far away so we can drop this to be maybe at um70 right so it's a bit less and maybe this a bit thicker to be 30 and now with those changes that should be better yeah so if our player is inside of this sphere we will apply damage so we just make sure that we have hited something right if this true we are going to be breaking the hit result and we can use the same get our H actor and just apply damage and that's it how much damage well depends may you like 10 and now we're good to go we just need to apply that damage into the player itself so let's go into the first person blueprints once again it is using the universal R uh thing so we can just go ahead and say apply damage sorry I play not event any damage so that's when we receive damage right and in this case we want to again have a health variable so let's create this let's change it to a float let's compile and let's put a default starting Health which will be just 100 now we're going to do exactly the same as we did so if you remember okay pause the video this is a challenge go ahead and subtract the health and then set it and then make sure that if we are uh you know if our health is less or equal than zero just go and uh Rock do player if you remember how to do so uh so just give it a go try and we'll cover this in a second okay so to do this we just go ahead and just subtract this by the incoming damage and then we can set the health to be the new one with the subtraction and then we can basically check if this health is less or equal than zero if so that means that we want our player to die so we can just get our mesh which is the uh body and you set simulate physics okay and now it will fall and we will just die and then an extra bonus thing is we're going to be disabling the input so we cannot move anymore great so that should work if I now were to just stay and be hit it a couple times we should die there we go and we just falling through the ground yes I know we're going to do a little change and just go to the mesh go down into the Collision settings change it to custom as you may remember we have to change to be Collision enabled query in physics so the bones can interact and now yes we'll wait and will fall and it will kind of fall and go with the ground it looks a bit bad but don't worry it will basically fade and restart the level so that will be ignored but now we have the damage system and health working okay so let's quickly create a UI slider there for our health bar so let's go into the HUD which that we created earlier add a progress bar let's just put it at the uh I don't know top um right maybe doesn't really matter let's make this a bit wider and like this change the Anor to be at the top right very important going to put the percent to be around per 7 so we can just preview it even though this will be over in and it change the color to be basically of course red great so with that said what we need to do is update this percent now very important this goes from zero to one okay not from um 0 to 100 so have that in mind so now what we can do is bind this and we can create a binding so every time a value changes in this case this value it will update the help bar automatically so we can basically cast to our first person character and just get get the player character and then what we can do is access our health variable okay in this case we cannot directly pass it because like I said this he variable goes from 0 to 100 like we have in our uh player right but in our progress bar it is from 0 to one so as simple as just dividing this by 100 because it's our max value and that will be giving us a value between 0 and one so now this will work we have a health bar and as you can see it will be decreasing as we go and we will basically die so cool stuff it basically works so now let's also make a hi image okay which will basically be an image that will be our damage image and it will just be um red uh and it will just fade in and fade out real quick so with the anchors open there's a trick and we can just hold control and press this full screen and it will fill the whole screen automatically which is pretty nice let's change the tint to be completely red okay like this and then we're going to say okay and let's create a new animation with this selected we're can go to the animations wit it if you don't see it you can just go and click here and create a new animation this will be use damage let's select that new animation and let's add a track for that image so just select it and now we can go down and on the um where is it where is it on the brush color and opacity we can change the alpha so by default it will be zero so it will be starting at zero so click a key frame and then after 25 seconds we'll make it to around3 so it'll be a bit visible let's add a new key frame and then it will be back at zero after a couple of milliseconds so now it will be very fast now it has to be a bit faster so let's with control zoom in okay and now let's just make this a bit like this and that's a bit better so you can see it's like very fast very effective boom and it will just work great so now let's go to the graph go to the event graph delete all this and let's create a new custom event that we can call which will be just damage uh UI in this case we just get our damage animation and just use the play animation [Music] Noe and with that said we're good to go compile save go back to the third first person Capt sorry go up and very important we have to uh hold out break this right click and convert it to a variable because of course we want to save this uh in a variable okay okay there you go so if we save it in a variable that means that we can use it let's connect this once again very important down here in our health so if this is false that means that we are still alive so that we want play the animation so we can say play damage animation I think I call it like that I don't even remember orpl [Music] animation how was it oh damage UI okay uh damage UI and now that will work so if I go and compile and press play you'll see that we don't have the H but if we press uh play and we receive damage it will play that little thing which works very well cool so with that said we have that done okay so now let's add a sound effect so when we receive damage so the whole uh experience will be completed right when we press damage so let's go into the uh folder in this case I have left another sound which is the grunt just drag it inside of our audio folder and now let's also duplicate one of our meta sounds and just rename this to be us GR and let's apply that ground sound effect and now we'll play different one every time which is pretty cool all right so with that said now we're going to go into the first person character and when we play the animation you we're going to also display a sound to the uh well a location will work and now this will be msor gr there we go and location will be get actor location now another thing I to do is create a sound attenuation but let's test this out real quick that will work great so a sound attenuation will allow us to play sounds in 3D which will complete the effect so let's go and do so so in our audio folder right click going into audio and create a sound attenuation this will be called _ um use caor because overall it will be the sounds coming from the character let's open this up it changes a bit so the inner radius will be 200 which is the minimum amount of distance to play it in totally 2D and the fall distance will be how far away the sound will play and it will slowly Fade Out so this time it will be something as 2,000 with that said we're going to save and go inside of all our MS sound click on source atation and edit so it be this one this one and this one and now they will be playing all in 3D so from the player perspective it will not really work but that's more uh if you know the enemy shoots or whatever which it will not shoot but you know what I mean like footsteps on some now you can see that when the player dies he will still attack me and move and everything that's because he's still alive we just rled him but the logic is still there so let's go and open up our AI blueprint print and we let's create a new variable which will be is De by default of course it will be false but in here when we set the r though we're going to set is that to be true and what we're going to do is get the uh this note which is um disable movement uh disable movement and then we just stop the movement that's important and then also when we attack we will only uh do this if we are not dead so for that we can get is dead and make a not bull so if this is not true well we can continue so that should be resolved now if I kill my enemy he will not move or attack me so there we go that's said and done so that will be saved okay so let's do one pretty much final thing about the controller and so on and as right now if we shoot on idle it looks great but if we shoot while we walking as you can see he shoots sideways and it doesn't look very good so let's make that the pistol will go back to like kind of as Idle animation right at the center so we can attack for is that couple of milliseconds that we're attacking so for that what we're going to do is select the go into content first person arms animations and you can see here we have the mm pistol idle a which is the one that we imported let's duplicate this and let's just rename this to use um pistol shoot right let's open this pistol shoot and let's just make it very short okay I don't know how short but I guess that around I don't know um four um five if so we can make it shorter okay so put the cursor on on on five okay I'm going to right click and remove frame 15 to 1551 and now we just beat this so from there we can just right click and create a montage and we're going to play that Montage when we should so very important let's enter in our animation blueprint of arms an in graph and add the default slot as I talked about before we need that to play the animation Montage now we're going to go into the um first person blue BL print and when we shoot we going do one more thing which is play montage and we can just use the uh yeah we need the play Montage node select the arms and play the shoot pistol shoot and now as you can see when we walk it will do that now it is very um it has to be quicker right so we can change things on the animation Montage let's open this up as the transitions in this case we have the blend in and the blend out so the blend in has to be very quick so maybe like 0.1 and you blend out like 4 it has to be kind of that combination so let's see that's a bit better it is faster um the blend out should be even more right like maybe s even uh I don't know we need to play with this values but okay so it is too long wait what if the blend out is also very uh quick oh this will be a bit better okay so let's do this like 35 oh there we go there you go so that's fixed now if we move we will also play a proper animation so we not be like shooting sideways which is pretty cool okay so now we can start to duplicate with alt of the enemies and start creating a Mayhem over here if they see me pretty cool um now another thing let's to quickly do is in the AI blueprint disable the um for duration sphere Trace bucket and now that should look good all right guys it is time to start creating the environment so for this what we're going to do is use some quick so M SC which of course are free so what we have to do is open up quick so bridge to import them so let's go up into window and click on quick so bridge in my case I already have it here so I already have downloaded some M scans as you can see I have a whole bunch of them for different things but in this case I want to use this weathered concrete uh wall I think it would look pretty cool so okay so I have to sign in uh but let's do this okay so let me import this weather concrete wall you can just search it by the name okay and just uh select the quality downloader Mye already done that and then click add into the project now this interface is very slow okay but like very slow so take your time to click it wait until you can hover other the things right that's when it has import we go if I minimize this here so take your time in this case I import more stuff as this um Rusty boat hole uh that's the other material that we use so let me click on ADD again a lot of patience um but basically I am going to be importing uh after this so let me just say the assets I will import and I'll import them off camera because it's going to take a lot so the next one will be tarpet crate so import that um then we'll have C Rumble and then we'll have this um rusty metal borrow okay and then we'll have this three different graffities now you can choose the ones that you like okay but it will be graffiti tag graffiti and graffiti tag okay so just choose whatever you like in this case my ones will be those and then I have a modular stained pillow kit and that will be it okay the other ones are for other stuff so I'll go ahead and use choose those so let me import this all right guys finally I have imported everything okay so don't worry if it takes a bit of time it it's normal it's mainly more of the UI and so on uh but we have everything so let's create a new level let's start to set some walls some floors and just apply the materials so let's go up into file new level and in this case it will be basic create okay so now we have this basic level and what what did our floor go okay it is loading thankfully okay I thought it was completely bugged out um so let's wait a second here okay so here it is everything loaded thankfully so we have this simple floor all right so let's apply a material to this floor to begin with in this case it will be um on their surfaces the weathered concrete drag it here so we'll use the same for the floor and for the walls okay so I am actually going to go and change bit the thailen to be like five and5 um so it looks a bit better there we go so let's begin to add our walls and we will actually use Simple cubes okay so just go up into the quickly add to the pro section shapes Cube drag it this will be our wall okay so we're going to go ahead and change the scale in this case we'll expand it across the uh this axis so I guess like five and five so let's see I guess of of height this will be pretty good and then this will be like more thin like this I think so let's press play uh maybe that's a bit too high I think it will work good honestly uh like four and four so it has to be even because if not it will be stretched okay very important um yeah I think that four will do the job so let's go ahead and just attach this to be the bottom I'm going to go into the me SC uh surfaces with they concr Dr it here okay so this actually we need to stretch it a bit more so I guess like seven yeah seven will work so 7.5 and four will be our measurements and to not stretch it and now we just need to start you know to begin making the walls so uh let's begin so I'm going get let me rotate this 90° and this will be the entrance okay which will you have already entered in this case for example right we'll just have this and then we'll have another wall rotate this 90° put this here and we'll just make it simple room okay so I'm not making anything fancy it will be just a simple room uh nothing crazy okay why did I move like that okay so make sure this is in local W position position because if not it will not work so hold out and just drag it in and we'll start to create walls okay um the same for here we'll drag it once more and we'll select this walls hold out and drag them to here and just um put them like this okay and yeah so this will be like an abandoned kind of place if you get me uh now this is very big so let me lock it and let me like half the size and let's put it over here maybe like five will do job okay this will be a better and as you can see they're not even but that's good because it's like a destroyed place so it will be better um with that said I am going to save this level so we're going to go into first person maps and this will be our actual map so let me just name it map let me just go ahead and hold out and duplicate the floor it will be way thinner so like 0 five or something like that okay so make sure to uh unlock the the this all right so that yeah that will be better maybe like one yeah one will work put this here okay and make sure to change the surface to be the rusty metal that would be this one okay and this is very big so like uh 3 and3 well that will make it bigger right uh so I may like two and two yeah two and two will work wow cool okay as you can see we are starting to get things but um you know it is looking a bit too bad and that's mainly because of post processing so let's go to unlit and work like this and we'll uh sort things a bit later so let's go ahead and just do this let me um just visualize this yeah so also I am kind of I don't know if you noticed but I'm inspiring on uh the bodycam game that was super pop popular a few months ago right I don't know if you remember so actually one of the trailers showcased a map kind of looking like this right so I honestly I get out of memory remember a bit how it was um made so I'm going to making this like this um so if it's similar it's because I'm taking heavy insiration of that game okay so let me uh just put this over here rotate this around ° and just put this like this as you can see it everything is not straight but that's going to done uh to make it symbolize it's like an abandoned lace you know uh so there we go it'll be more like this like this until maybe here so holding out is the key okay to duplicate and make sure there no overlapping so artifacts will not occur so you going see um and this should look pretty cool all right there we go and for me I stretch this okay and they should work okay so we are starting to have something now we have to this is not really a horror game so there's a lot of things to change in here on the um lighting and Ambiance okay so first of all let's go back into lit mode and add a post process volume that's the first thing drag it into level okay and three Touchstone things so on the post press volume let's search for infinity and just turn it on so it will affect everything that is not only inside of this bounce but the whole level in general let's go into exposure go to me and Max and let's lock it in one so the exposure will be locked great so now what I want to do is just play around so I think that three will make it a bit more exciting and then I am going to change the exponential height fug to be volumetric and then I'm going to change to un lit and make a gap for some um some light so let me open this up okay let me duplicate this like this and then duplicate this and put it like here and just do like this so basically I'm doing a little gap for light to come in okay and don't worry I know it's looking very bad because it's all like squashed um so actually I'm going to just make it taller so we not overlap there we go um so the wall where is the wall W okay there cuz that should kind of work so if I go to lit the light will be in there which is what I basically want which is pretty cool yeah so we kind of come in there okay so uh yeah so with uh if you hold contrl L you can move around the lighting in my case it will be this angle okay you can copy the the angles if you want to get the same effect as me um then I am going to also add a flashlight into the player's head so we can see bit better so let me quickly go to the first person Blueprints and just add a flashlight so in my case it's going to be in the camera actually it would be cooler if it's in the pistol right yeah yeah so let's add um a spotlight and this will be a flashlight and we can anchor it into our muscle which is right at the tip and now we have a little flashlight as you can see which looks pretty cool and will animate and everything which is cool um then more things let me make the directional light I think more intensive so like 12 and let me open up another part over here okay so more light will enter in this area so let me and how do I do this okay this I'm going crazy uh okay I guess like that and then um backwards so this is where okay yes like this is a better yes um and then hold out move move to here yes and then uh hold alt so we're basically making holes okay yeah that's pretty cool I think um H all right all right all right and then I'm going to make like get this and hold and duplicate them up so we won't see this Sky it will be like other blocks there we go it's like blocked cool so we're starting to have things so let me go ahead and also add some other uh spotlights over here okay so it'll be like here and we can just make it on lit and we can see how we can kind of make this look pretty cool all right make it a bit more orangey just a bit well more I think like this can kind of make it like this and just put some spotlights across the level you know that's basically what I'm doing nothing crazy um but we'll improve them later because they're just literally like that okay so let's add some rumbles and so on so for that enter a make a scans through the assets and we have our Rumble and start to add a over here and let's make it way bigger so let's lock it and let's put like three or something something and we can filling more so the trick here is just basically going ahead and duplicating and rotating okay that's the thing so let me add it across pretty much the whole wall over here let me rotate this and we're going to add it in all of the corners okay that's how we're going to go ahead and just add a lot of um detail into it okay there we go and then we are also going to go ahead and just add more in general at the middle but it will be kind of uh smaller you know what I mean smaller piles so we're going to add some rum like this okay and this will kind of work like this and as you can see this will improve a lot how it looks like I so and as you can see it is slowly looking pretty damn cool with all the from they're pretty real pretty realistic so we basically need to add kind of more so I mean it's a whole job because it's it's very simple but it is very tedious right because we have to start to go ahead and just add all the rumble and it's uh it's his job you know but like this thing will be pretty cool so let's add some more all right like this nothing crazy so we can put it in leads to see also how it's looking wow the with the light it does look great very important I like to some of them just make them taller to add some um some volume into them you know um no lot of them of course all right okay and then we can make the borders more uh like this right so they feel like the rumble is um slowly going off right it's not like directly like a very sharp end so it'll be bit more realistic you know um so we're going to put it back to un little bit there we go and we just make it feel a bit more realistic as you can see which looks pretty cool and let's also just go into 3D acids and start to add some of the pillars so we can rag them into a level oh my goodness uh and we that was oh right I add the other one okay I want the tall one there we go let make it uh reach the ground right the ground not the you know what I mean the ceiling right so let's add a few of them here because does improve this a lot and let's add also some um of this barrows over here so basically go and add this one and then this right um a bit smaller so may like 7 let's put this here duplicate this one here May maybe this one will be a bit bigger so like 1.2 we can select all them put in this one and change a bit the order so this one will be more like here this one like here this one like here right and slowly you get a bit of uh the environment going on right nothing crazy but I think it looks pretty cool and more things we can add this crate over here into here two and so one and that looks pretty pretty cool uh this one I'm going to delete it I don't really like it I it looks cool like this and in this case I'm going to think maybe hide this thing because it's like very marked right um H maybe we can play around with the lighting again but I think this one's pretty cool it's more like direct inside of it U well maybe we can add a bit of an angle right so like I don't know what it even is but um more into here there we go that looks a bit nicer you know we can play around with that really like it so let also very important add now the nap mesh bous volume because it's how the AI will work so let's fill this up with May 50 so it will cover the whole map so you can see and let's add our Ai and we press play our AI will already be there looking pretty damn cool and you see how everything is going ahead and looking pretty cool so basically I have to the same kind of decate through those things so let me do it real quick just as some rumble of the borders and so on all right so I have um you you know added some more rumble or let me just kill the AI a bit more rumble on the edges of some of the places I used to call with some barrels on the crate right and then we'll Rumble here nothing crazy just basically what we were doing here but just bit more here um and that's it so another thing that I want to mention is you can see that message saying that the uh texture streaming pool is over the whatever number budget that's because well quicking as can assets are pretty heavy in the so what we have to do is go to console command and you type art. streaming. pool size and then we can just put whatever value we want in this case for example 7,000 and now that message will be gone as you can see and there we go and also let's just um what I'm doing is uh duplicating this wall to put one and it will be like a kind of a dark wall so you know that you cannot exit that way so let me create a quick like but actually there's already probably black material that we can use right or maybe not yeah there is um there we go this is the one that was searching for be purely black so it symbolizes that we cannot go there um so yeah there we go so the environment is pretty much done uh we need to set collisions for this which will do in a second and then we'll replace the enemies C to models which a cooler one and that should be it it we can do some retouches but and and the fade out to restart level but that's it so let's add the collisions so in this case let's start with the barrows select them in the level press contr e as control edit this will open them up I can just add a simple um box simplify Collision so because they they don't need to be accurate we can save resources and performance by just adding a simple box cation because we just want to not go over them nothing crazy the same with this once again it will be a simple box colation because we don't need nothing crazy and then with the crate exactly the same thing they have pretty much the shape of a cube or a box right so we can just do that like a so hopefully there we go we not crash and we're going to save that and then we have collisions now for the rumble um I am going to leave them without collisions because well you know like you can just kind of walk over them and they they have a lot of geometry so I will just leave them without collisions okay I would not think this a a huge deal okay so quickly let's make that if you die the level will restart so let me make a fade screen so let's duplicate the damage image and do a fade image in this case the brush will be completely um opaque okay it's black and dark and then I'm going to go ahead and just um create a new animation okay which will be fade and this fade will go from you know alpha0 to .5 so it be take a bit longer to completely one okay like that and then it will stay at one uh for a couple of seconds right and then we'll restart the level so if I go out make sure that this by default is zero okay so make sure to deselect the animation and set it to zero so now we can just create another thing custom event right which will be fade fed animation and now yes we're going get the uh fade and the play animation node and with that said we are ready to go we just need to go here when we uh die right in the health which is here get the h widget and just call the uh fade animation event and with that said after a delay of how much was it let me double check um of15 seconds we can just uh you know weart the level and to be safe I'm going to do it as 1.48 so I have a bit of space between them and then we use open level and this will be a map so it will basically reopen the map once again and now if I were to die by the enemy AI we get a fade which worked very bad and that's because it is repeating so make sure to do a do once okay because the enemy will keep attacking and it will keep making um you know damage and it will keep going to this condition and resetting all this uh so now that should be in theory working let me test it out we go we Fade Out and weart the level so everything is going ahead and working so pretty cool so let's go ahead and restart uh sorry restart now the just replace the enemy AI model one quick thing though is I'm going to increase the fov of the camera to around 120 because uh you will see that it will look really good and create a more of a kind of feeling as you can see that looks great uh now maybe 120 is too much so maybe like 110 105 uh well 12 uh and you can see that it will look a bit nicer and cooler right I think with a greater fob um so that's cool so we are going to be using this scii character so let's go ahead and get it is completely free let's click add to project and let's go ahead and select our project at to bre and now let's go ahead and wait okay so it has imported it is here and we can see the mesh with the the whole things right so let's go into the AI and let's replace it right so let's go into AI in this case it will be the blueprint mesh and on the scale mesh we have now more options now we have it separately or joint in this case of course joint and we have a few options I think that this this one will work that looks pretty cool U yeah this one looks pretty cool it's like I think it has like blue or something in the face um oh yeah this one this one will work looks pretty cool for me you can choose whatever you want uh yeah that looks way cooler all right so oh yeah that's cooler okay so last things now yes or yes okay we're going to add some Ambience sound okay to make this like a bit more not really spooky but more atmospheric and then we are also going to be adding some screams for the AI so it feels a bit more I guess also just intimidating so let's go and do so all right so here are the sounds we have the AI scream and ambient Loop let's import them into our project in this case we're going to double click on the Ambiance Loop and click looping very important okay so now what I can do is just drag the ambient loope into the level and it will just play in a loop which is pretty cool and then the AI screen well I have to basically ahead and just duplicate The Meta sound so it will be different every time once again quickly do this and it will be AI scream if I know how to type there we go and now I'm going to go ahead and just put the AI scream to be here and then whenever the AI sees the player I am going to do so which will be on the AI uh perception AI controller so on here I'm going to do this a two ones and there we go okay so Ms AI scream location and we cannot just do get after location we have to basically get the owner of the AI perception okay and then get the actor location okay because this is the AI controller so now if he sees us there you go he shouts and I'm going to do also uh when he attacks also play it so let me copy this notes go here and um so here let's make a random Boolean which will play the sound or not okay so very important also uh the uh M sound has to have the attenuation so be in 3D there we go so it'll be realistic and then here we're going to do a random boo okay so depending on this it will May shout or not when he [Music] attacks pretty pretty cool honestly all right so that's pretty much it um we can you know play around a bit with the fog and so on but overall that's what we got guys I think that honestly um it's looking pretty cool not going to lie um so yeah we can play with the scattering as one the extinction skill all this kind of stuff so yeah we go and also I like to touch a bit of the post processing U bit of the um kind of the colors and so on so if we go down we can also add some chromatic operation that's also pretty good so like 7 and then in the global color grading saturation like1 and in contrast also like1 so being it will bring things a bit more to life you know and then also I like to add some kind of a grain right it looks pretty cool uh so film grain we can add a bit so like five and now it does look pretty cool and of course we can add more AIS into the level to fully pull this out but you get the idea this now is pretty much complete uh now one quick thing is that I'm going to decrease the AI perception sight radius to around 1,500 and the vision to like 80 or actually 78 something like that and then lose side radius to yeah that's pretty good all right so now yes we have it complete and let's check this [Music] out [Music] so that's it guys if you found this tutorial helpful I would really appreciate if you could like the video and subscribe to my channel it took a lot of effort and time remember that the project files are available in my patreon and YouTube members just in case you want to download the whole project with all the code and stuff so check it out through the link in the description join my Discord server follow me on my socials and now yes with all that said [Music] bye-bye
Info
Channel: Gorka Games
Views: 68,433
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, first person shooter game, tutorial, quixel, unreal engine first person shooter game, fp shooter game unreal engine 5, ue5 first person shooter, ue5 beginner tutorial, ue5 how to make a first person shooter, unreal engine 5 simple beginner tutorial, unreal engine 5 beginner game, unreal engine 4, ue4, unreal engine 5 easy game tutorial, ue5 make realistic shooter fps game tutorial, beginner fps shooter game in ue5, fps game ue5
Id: u30H_7jwjo8
Channel Id: undefined
Length: 117min 8sec (7028 seconds)
Published: Mon Oct 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.