welcome back to creating a first and third person shooter in Unreal Engine 4 this is part for shooting impacts and making things go boom and birth person this is keith also known as dark over 4 minus pursuits and let’s dive in the software we’re going to use in this session is unreal engine 4 92 we are going to use the epic animation starter back and we’ll use the gun model from the 49 decks first person template that comes with Unreal Engine they’ve updated that gun model and will work very nicely for us for an assault rifle the objectives for the session we’re going to create a crosshair we are going to expand our base instant hit weapon blueprint we’re going to implement an assault rifle blueprint we will show how to support single shot repeat a child or shotgun style shots and will bind the ammo in our hutton or we’re not going to do in this session is to talk about down sights aiming that will come up in a future video oh we go ahead and dive in shall we okay so if we go back and we look at in realtà moment where we left off we now have our health and our armor showing and we have a spot for an ammo type and mor meaning although we haven’t flushed those out enough yet to do it we do have shared blueprints Hornets and hit weapon melee weapon based off our base often here we’re going to flesh out our if they hit weapon further another going to make another child blueprint to be an assault rifle we are going to create a crosshair for when we’re in third person mode I’m a little in first for first person mode on third person mode I will handle like next week it will be doing that differently and we’ll just generally get into all things work closely solve our blade though so remember you press C oops we’re going to proceed to switch to your camera between modes so here’s our first person mode what’s called true first person we can look down with the tea i bought in our hands the movie handle jumping and stuff but see you again we’re back in third person mode so those are two modes so I saw a rat we’re going to build a hype component to be our crosshair to do that I’m going to jump over to photoshop I’ll be right back here we are in Photoshop again you can use or any application that supports alpha channels this is going to be a very very simple little crosshair we are going to create it to be 50 by 50 for the maximum size make sure we have a transparent background say okay start it up there or the sake of being able to see it you might create a new layer here oops getting new layer here and fill that with just a light gray color or something this filled out and if you’re saying well we made a transparent lie feel that well we’re doing it just to make it easier to see while we’re drawing a crosshair we don’t entra need it for the long run we will zoom in a little bit you can create another layer on top of it and now I’m not going to spend a lot of time trying to do this I just don’t think there’s any point to doing so what I’m going to do is I’m going to make a cursor the square-shaped going to make a white long edges I’m going to be 2 pixels wide so one single thin line with that so it’s right in the center of the work scope okay let me go back to three second well it is still selected double cook actually I want to get rid of oil in your lines may be able to make this now now believe like it is

what we’re going to do is this we are going to take and render it so rasterize to layer now it just becomes normal vision app again we’re going to find are you way sir increase in size of the eraser of it to 10 now 10 pixels shift to make certain going straight line I’m going to go straight down like that and then in the center of it don’t you find my cheek plug in here line tool inside of it this a straight line but down 15 pixels and then we only want that to be two points not three multicolored to be white once we event reward is it us and we’re going to duplicate it to duplicate layer I’m going to rotate that 90 degrees oops okay the whole time I only meant to rotate that one to turn into our route 89 you exact lines there we go and we’ve got a plus sign and then we’ll be able to do later is we can actually put a little health bar on the left and we’ll bar on the right scoops will be able to see that now that we’ve got that done let’s actually drop that in a little more just go to canvas enemies canvassize this 25 x 35 everything the center see you there we go off at Lee entirely but turn it off will be sufficient we’re going to say this as PNG format let me see that our first person crosshair to FP crosser for shop and we’ll go back to our meal so back around rail we need to add some stuff to our UI so we’re going to create the new widget it’s going to be a blueprint so there’s a uwb p a p cross air just enter the notes for first person mode we are going to have to import that crosshair that we had i’m going to import and actually say that in the dropbox folder FP clutter it up and it is there we double click on it you can see it’s internally here save that for now and then our abvp FP crosshair we’re actually going to change this to a custom size which is going to be 50 by 50 so write that down to the center use the scroll bar to zoom in a bit easier to see we’re going to put our image into the center of it for our brush we’re going to choose our FP crosshair i’m going to change that size bed too large is so 33 was 35 x 35 it’s not really going to matter a lot and we want our

anchor for that to be in the center take this put in the time if you use the arrow keys check some stuff so it’s not perfectly centered go to a one snap for a second this is part of the fun of all this the real you can then actually line up your crosshair with this you will be all set now we won’t add our well actually let’s go ahead let’s have some fun let’s do it let’s get a progress bar we’re going to pull in their progress bars them fill up from bottom to top that she do anything chicken fifty percent rotate this potentially there we go point five we want to go from the top out short to first time so there we go so even make it a little bit thinner okay health is usually green so we’re going to go ahead and keep that green go slightly darker green let’s see here in for that based on the center as well alone image on or anything and then you will actually go ahead and copy of it this side change the color event to be red so it will be our ammo and it’s making yellow crmo and let me combine some of this up real quick so take our buying here create a pining for the health and health hopes come on I’ll come out better character cast that to each player character mmm your player character why don’t you get else max health make sure you have actually created myself let’s go back and look for a second characters are shared blueprints by your character attributes yep we have a health but we have no man itself so let’s go ahead and let’s create a variable which is next health which will be a float ok I’ll in it two attributes next up will be 100

just to make it easy for now and of course if you didn’t want to do the didn’t want to do the mo and your crosshair you could always do your armor as well and then you would have an axe all for your armor which is something we’re going to have to add any way we’ll go like this and we are going to divide health by our max health and then that’s a return value to HUD now back to our UI at the moment we are going to add it to our base hut but it’s not going to be visible yet so on to our base head we’ve got the space widget here actually we’ll come back to it or the mole going to Adam just I always be visible e1 war in third person mode just for the moment and then the end will come back round to make it tore it only and it’s just for now I’m thinking about what I’m going to have bad news Ilana it’s one of our side playing with that right now so let’s go to our base widget class instead and we are going to find our crosshair your user created change our panel here it’s up there pull it down need to find the center of arts conscience this is 1280 by 720 and it would be 640 by 480 so obviously that was right now not certain one use that anger to be in the center a position x and y is based off of the anchor right now we should be all set awesome is x 15 respond right so let’s compile and save playing I said it’s right and all of our guy we switch DC it’s there might actually want to make it a little bigger it’s kinda small at the moment you can see reflux are our health right now back into our base widget click on the processor again a 100 this is a Fionna so you much play person in rural sighs so let’s go back to our would-be

frontier for a second she’s just 100 it’s in 77 offset 30 offset sends it up again and we’ve got our progress bar which we need to order watch sighs excellent to 12 songs why you say so it’s opened are the ones and then well we save know if we play there we go now it’s a larger size to respire mode again you can see your health is filled up our ammo is just nothing because we own any mo yet we’re all set so we have a crosshair across here is what we’re going to shoot at so now let’s go in and let’s take a look at our weapon blueprint again so our base weapon we never lot we have the mesh we have the name of the weapon weather was breakable and the resiliency so not a lot in at the moment it’s okay if we go to our instant hit weapon we flush it out quite a bit more start implementing empty functions for our basic workflow we have holders for visuals or attributes ammo max ammo ammo tape this case is no title in the painting class not a not an actor but let’s go ahead and let’s think about what we need dhampir so we’re going to have to create a base blueprint for our ammo tape let’s do that to the blueprint class which accidentally a cure for them what need is a strut for a second using mm let’s do that instead it’s an EDM you numeration the structure that’s we want my words were set instruct so we are going to have a st st mo space now with in here we can put information related to our MMO so we can have our first one can be the name

of the ammo the name right let’s call it base panel this is for showing health ins work you have a new variable which is gets damaged be a float no one which is image type if you actually be a teen um it’s doing that because we’re multiple in on tapes is actually hook up in on one there let’s get that for the moment I can look back later I sure you’ll say real damage ? I will not put a grenade type mo or not now let’s see we also need not certain I think that might be it Oh see that one which is note you clip so if we are reloading with a new clip how much should be loaded in a photo as well save that for the moment this is weapon back up just so you can look and see here always now let’s look back up in attributes and such so we had ammo type we have potentially impacts decision we can hold animation which we can particle system yes particle system class choose impact system and eventually we’re going to want 14 different physical surfaces know if it’s going to make sense to try that right now or not so I think we’re going to wait so let’s save that as well and then we just be it okay so if we go back over here we go to our ammo type now we can actually change this now that we know what this is going to be this is going to be a structure type mo base actually created real ammo types yet to put in there compile and say that now let’s go ahead and let’s take one of

these let’s copy it see child or standard bullet if we go in here now and would be a standard bullet base damage let’s say is and what I want to say five maybe there’s no radio damage if you pick up clip there will be ten in the clip at the one we don’t have an impact particle system because we don’t have any variable systems loaded so we’ll say that and this is where you start to keep track of all the different things you’re working with because as we make changes we’re going to be making changes within the instant hip weapon there might be changes we make to the base weapon just as we see how things flow so we now have our standard bullet type we have our base incident weapon that has our workflow contained within so what we’re going to want to do is to make a trial blueprint of this Oh actually we’re going to make a small and subtle change tour on fire input which is krauser blood space for the vector and now we know we’re in world space our crosshairs actually pointing at because we want to feed that into other things later on like are determined hit objects actually want to ND okay wait space okay i’ll work ball here can look on fire decrement ammo count play muzzle flash play fire sound those are related to the specific weapon something objects fly damage detectors there will actually give information from our our bullet or no mo sound now there’s a good question which is does mo have a specific sound cue associated with it baseball type of mo not certain but we should probably have impact sound distant sound cue so I mean about going back and forth as you think of things so it’s good just to have them open okay so let’s go ahead now let’s leave a child a prison a weapon which will be VPC assault rifle we’ll go ahead and open that and if you really want let’s close that again really want it’s not a bad you do this make a new folder for just salt right foot go ahead and drag your blueprint in there now we can add any animations or specific meshes or whatever to this as we as we need to so if we open it up we have just our data only blueprints only your whole blueprint editor we’re going to want to assign a mesh so we can do that but first let’s go in just our attributes so the ammo type for this yes there is an actual issue which is in

here for ammo type actually need this to be website that dynamically when we pick up a type of ammo sorry myself off here try to remember back today you know we’re treating MMOs a separate object so we don’t need to fill that in right now however we will want mean at least for the moment we’re not going to worry about whether it’s breakable our resiliency don’t worry about those visuals right now either we need to get our mesh and so this leads to the next one area to get our mesh we’re going to have to create a new base project of the first person shooter template so I’m going to jump out to the epic launcher and I’ll be way back now in the epic launcher you would want to watch for dot 92 and create a new type of the first person template and I’ve already done that here it’s called FP base on both of you because we’re gonna have to take the time to keep waiting for them i’m going to double-click and open it up so you can see what it looks like if you haven’t looked at it already you should look at some of the new templates it’s nothing else they’ve they’ve changed some of the designs to make the more detail then more useful so in this case if we play if you remember the prior to 499 version of the gun you can see that this this gun is a lot more useful and in detailed well would argue it’s still not shooting at their own crosshair button if you go into the weapon and you look at the mesh skeleton for it rotate around it and you can see it’s to follow more like rightful so we’re going to go ahead and use this and the way we’re going to do that is we are going to migrate until we need to migrate assets over be nice if we could just choose to make specific ones that they wanted doesn’t work that way it makes its move over everything already do that we’re going to go ahead and remove it and to our first person meets at the final bit over full of your first person game is in you got to move to the content folder doesn’t give you a choice until we do that for an end Final Four copied close that out and go back to our rich person game if we go in here now you’ll see that we have other things first person here we go so if you’re looking at first person our first personal weapon is there you’ll just have to copy the first person stuff into the library folder but I’ll do that later do that right now but for a weapon that controls our way fold go back to our assault rifle and now we actually have any ready-made mesh that we can use so with a skeletal mesh and those we actually wanted there we go sculpt an FP gun so there is our weapon for our assault rifle until we get the textures in with a minute and we should be all set there should be nothing else we have to do there I don’t believe it has an animations or anything we double check if I a montage for your arms but when I using those first person arms listen I can help us cylinder comes with increase your

there’s no particle flash system and fire sound we don’t never sound cue for our prior so either even though they play we’re in there must be something get transferred so we’re just going to save that for the moment because we’re just going to check some stuff out and if we go to our character now to our gunfighter okay I don’t think we’ve set them up to have a weapon yet so I’m in play let’s spawn after for them it’s on after respond and after that is our EP assault rifle we are going to get controller it’s going to become for yourself it’s going to become our instigator as well as our owner and are transformed for its going to spawn at will be our socket but we have a socket yet for this so let’s go back and let’s na socket for guns so we open that up there we go you still get that sword it’s fine meal a socket and that’s remove that asset or hand now we’re going to create another topic topic another socket which is going to be called gun socket okay we’re going to put a preview s in there which is going to be our esky gun this can you rifle I can find it here there we go okay first person vendors you can see we need to work with our rotation all that so let’s go ahead and do that run a bit and I talked about before one of the best ways to really do this if they have the animation up so we go ahead and we go to do the approach i know right let’s go I owe a rifle iron Heights our insights and made sense watching too much reliance lately ok so for you this is it’s a chance to see where our sockets and stuff we’re at and how screwed up they are so it concern me from some real adjustments based upon the way the animations actually been lucky which becomes a lots more helpful mine are actual socket for the trigger do that one right there bad that we were actually saw fit button that you can see it’s going into his face that’s not right we’re going to want to rotate basically it’s always fun getting things are lining up correctly so in that mark a shin ok also I believe to be four mana zone okay so Larry’s

holy it correctly saint-meran seats in this in real life being very very precise about this look really good move forward ever so slightly looks like the people looking at our two busted into the crook shoulder as i said i know i’m being a little actually overly in milan being this lined up but if you’re going to do it we should be right and it’s not perfect as fingers are going into it but nothing it’s close enough so let’s say that I look at the animations in motion again a little bit so it’s it’s okay it looks ok so I think we’re good let’s save this gunfighter we are going to transform by in the socket ressaca transform or the mesh just move those out of your them on that TV things going on your socket wrench on the mesh called that our gun sockets and we’re world space once we have that we want to attach it to our connector to attention to is yourself attention to the gem socket I’ll keep world position so compile and save that and one last thing we’re going to do is we are going to go into our game mode which is over engine blueprints and V mode currently we haven’t set to our mail a warrior let’s change it to our gunfighter compile and say that now if we play more in third person so it’s and i receive he’s got his gun we change the first person mode you can seize he’s holding this gun in there and we’re going to move our animation blueprint some place perfect en can moves around we could in

theory set up a second socket to attempts at hindu we could change them the animations going each running and all that and that’s all fine tuning stuff that we can get to eventually but we’re not going to worry about it right now so we’ve got all that so I’ve stepped away from lunch came back and realize that there a couple things we need to change that’s part of the problem with doing this on the Flies I’ve stayed down figuring out everything in advance so a couple things are we added our responde a initial weapon for our gun fighter if the problem is we never actually saved it we didn’t store a reference to it anywhere it’s what we really want to do is we want to go ahead and in our gun fighter base blueprint we want to set a primary weapon variable to be reference to bet that one and then we’ll attach it to the actor and that way we have our reference to our weapon so we can keep on using it and then we would actually want to assign our ammo or else we have no initial ammo in there so what I want to do is you’re going to go back to our weapons and shared blueprints here and out of thought which is that I really don’t want to use this type of ammo base so I’m going to actually delete these I was originally going to avoid using any sort of actor for this but dunn’s I mean that’s the best way to approach this is actually to create a component so we can do a blueprint we’re actually going to do as an actor component select then GP base we double click that you’ll see it doesn’t actually have the viewport and everything because this just attaches to another actor and so we can do we can go hearing when you quit our variable so there’s our main for the mo edible the type name lent base ml we can add our please take damage please damage which would be a float so that’s be five we can actually use that damage tape so what type of damage this mo does it allows us to use our damage type struct or dupont and then let’s see here we want to know amount and you good that we can have integer editable ion will say that there’s ten in the clip and then when you actually have particle systems of impact protocol system discipline to the particle system yes and our sound impact sound a sound cue editable also now here’s the years the important thing about switching to the component from the enum which is we can now actually add functions in here so for while we’re getting started i’m going to use like our impact particle system and our impact sound just to set one for the purpose of testing but long run what we can actually do is we can create a function then four get particle system and get particle sound based upon the physical material of what we’ve actually shot which is something we can’t do with a structure so I functionality would have ended up having

to be coded into the weapon itself now we can actually have functions for this in the ammo type that can be called by the weapon jumeirah compile this and save it now we have it and we’ll go back to our shared blueprint for our character so let’s find our gunfighter here and let’s give it to our gunfighter so we are going to bomb is the right word let’s go BB and we’ll base so I’m going to do this we’re going to add it to our primary weapon what this actually allows us to do then is we were to take our primary weapon after this point would you get our mo base and then we can say I’m on to new clip damage damage type vertical and so on she’s actually going to say okay let’s get Armand to our new clip from a mo base component and then we can add that to our overall ammo which resolves we shall do here tell them are inherited variables oops nope nor a primary weapon on me it’s in our ammo and i’ll move this and we’ve actually got two different types here so we might want to change that emel is a float so we can easily turn into a but we can go back to our blueprint for mo base we can turn mo amount a new clip into a float file we’ll save that now come back to gunfighter that’s broken visiting you at that well anymore let me plug that directly in and so we’ve set our ammo to start based on what our clip can hold well we fold our logic all the way through we created a weapon sort of reference to it we attach it to our actors who is actually holding it and then we went ahead and attached an ammo type to our weapon and got the amount of ammo based upon what would be in a new clip so all is set and good there so one of things we’re going to want to do is now that we’re going to have an ammo amount we are going to want to go back to our HUD as we’ve all just take care of at once let’s go back to our HUD animal widgets ammo type we’re going to do here is for our content we’re going to frame you bind I’ll going to call this bind get animal name okay once again we got to work our way through the chain so get player character to cast to our player character typing in this case we won’t have animal unless we are using a gun fighter it’s not something we’re going to actually have to take care of at some point as well okay so as we’re gunfighter we need to get our primary weapon primary weapon we’re going to get our ml we’ll get our max ammo oops rear

10 on doing that yet we’re getting the name of our first up so we need to get name the name of the so we actually your primary weapon I think about this for just a second we should be able to get away from salon you that’s why our primary weapon is just a regular primary weapon I film you cast a to gas tank always important to cast us to an instant hit weapon and there’s a instant hit weapon rbp mo base guess I’m gonna have to cast that too they built this for just a moment this should point it should be attached but it doesn’t necessarily know that it’s attached so if I attached a BPM Oh base to it I’ll that I’ll activate it that’s a different one replicate that or not Jason way the mo but I still learn to get a BP animal base there I can get name of the BPM Oh base return that took airless what happens by our weapons are you okay so we don’t need the cast in this case because it knows that that’s what it should be so just kind of those there makes big change going era where cast fails we don’t do anything it’s okay moment save this right now do you want to go back to our gunfighter for a second I know if we want to you and our base if we want to set our mo base so let’s take a look if I much there’s an activate set BPM Oh base and

that’s where we can creating a new type and I have to get up and keep the noise off okay so what we actually have to have is we have to have a type of BPM obey so we’re going to stick in there but for now we are going to use the default base so I’m not going to worry about it i’m going to stick with what we’ve got we’ll just connect that up and therefore we can go ahead at the primary weapon Connor and well base Ramona vase get the molten the clip and all that will be good except doesn’t like that person losing okay so not only do i do that i have to connect it up to their fair real always fun always one pile which is okay one sick a look now no type is base amma which is what we wanted now we can go in grab our ammo count so we look back to the designer there click an ammo count we’re going to the same process so our text let’s go to our player character cast our player character to a gunfighter because again or melee warriors won’t have ammo so our gunfighter we’re going to get our weapon primary weapon lament we’ll get our mo also get our own maximal division to divide our mo by our max ammo depend on how much we have to set a progress bar this case went during the progress bar we’re doing the text so we need to convert this to text and it will actually do that automatically over wire it up CR to text folks is there where that up compile its again if we play this is IMO is Carly zero let’s go back and take a look we are getting on mo value from our renovator hear from your weapon with gamma base so mo base and our primary weapon which is an assault rifle that’s fine appc assault rifle so in our assault rifle under assault rifle we click on the VPN low base for component we currently have no am on new clip so let’s put 10 in there compile and play still not picking up on ammo properly for some reason so Don’s I me is the reason why our animal count isn’t showing up correctly here is because I’m not thinking about my binding correctly if we go look at our binding we get our

player character then we do our division everything we need to for the present but not for what we need for the text so that was a bit of a mistake let’s alter this because in text mode we’re going to show it differently in text mode we are going to turn this into a strain so we need to build string oops i can type correctly we’re actually build the string of int float follow is it would show is period afterwards out there forever but back to the conversions its truncate suffix will be space / space same thing with our max ammo here we build string and together one and plug into our return node now if we compile and we play you can see we’ve got base ammo showing for our ammo type and we’ve got mo en is 10 out of 15 now if we want to wire up that right side of our thing we can do that but first I want to go back and we’ll change this function name so I’ve done that but hold on get mo text save it we’ll go back to our design up and then we need to find out a crosshair WV if the crosshair click on the right side one and you define Ferriero a percent bar create new binding there in give me so a wonderful on you getting our player character whoops our cast and for Louis were wondering well how is this going to work when we have the male a warrior up the reality is I’m going to show you how we plop a different version of the head or a male a warrior so it will be dynamically chosen based upon what the classes are so the gunfighter we need to get to primary weapon animal next MO so far so free forward and then we’re going to do our division look / vote and then we’ll plug that value in I’ll play and you can see that inserting the reason why it’s small again remember is we’re only using the start value of our first clip and a max ammo of 50 so we don’t creminem you’re firing going on so we can’t tpo amo but so here we go now save this out quick deal with the other thing that I said I was going to deal with let’s make it to our cross there isn’t visible when we’re in third person mode let’s go to our character moment and remember to know bass player

character if it’s justin gun either thought it was gonna be so it’s under control or never mind control the controller controller so we’ve got this see here change our cam around an active and not active in all works we’re going to do is then our character bass player character we’re going to add an attribute just a boolean first-person save that one the door your flip-flop back and forth when you first go in set it up tell these fun to do this do a different cast again if any messy but Soviet going to set our first person variable just happen to have one or in there get this again this way our first person variables and said to be on or off true or false based upon whether we are in first person or not genlock whole spaghetti is here your way to do this but when we’re trying to show you how to get stuff done not necessarily had to be super neat if you want to be super neat I trust you can figure that one out so we’ll save that c4 character base and then for our visibility for our which isn’t I base widget behavior for the fries here we can do a bind let’s call this yet person i actually get camma date so it’s really what we’re talking about so i get a camera state and it’s always wait to get our player character to our cast get our hammock stage boom no get the first person come to the mine ok and now based off of this we’re going to make this visible or not so we’re getting a temporary variable or walk a variable in you it’s going to be state and take the stage he’s going to be e site visibility them stereo in the branch ok the first person is true then we are going to set flight divisible but it is false they’re

going to you set it to it that’s not going to work one or even though I tried that take our state down here and that’s what we will return so we’ll compile this play see it’s not currently visible but we get see when we go to first-person mode and it becomes visible let’s see again to go back to third person and it’s not zan and the real now I have been recording for our already and I’ve learned my lesson about trying to record for too long and then going back and doing a bunch of editing and having split things so here’s what’s going to happen i am going to stop this video at this point and get everything edited and put this up for tonight and then i am going to record the second part and i’m still going to put it up this week you’re not going to have to wait until next week to finish learning how to make this weapon shoot but it will be posted probably friday night and in that part will go through and we’re going to cover how to view the single-shot the automatic shot 10 the shotgun dropped and it’s not that difficult once we get into it it’s just because it’s a two-part step it’s going to take more explaining than if you were just to go back and watch steve the previous videos I’ve done like thee the top down shooter is a little different than how it’s been handled no self I want to make certain have plenty of time to cover so i will see you in the next tutorial you