Unreal Engine 5 Tutorial - Smooth Aim OffSets

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's going on everybody James here from artificial entertainment and welcome to another Unreal Engine 5 tutorial and today we're going to be taking a look at Aim offsets so let's go ahead and dive in all right so I have here a third person project that we're going to be working out of and I have here the handgun aim Idol and this is going to be the base pose for our aim offset now before we continue on a couple of things I just want to note first thing is is that I was originally planning on making the aim offset and the upcoming damage video part of the multi-weapon system series but realistically these are Standalone systems so they're going to be Standalone videos however there are going to be continuations to that series that are going to be coming out in the future now the next thing is going is more related to the current project and that's going to be we are in Unreal Engine 5.1 and uh realistically you are going to need a couple of things to be able to make this work the the first one is going to be that you're going to need the um idle animation and the second thing that I want to make sure you understand is that you don't just use a offsets for where you can point your gun you can use it for where you can point your head where you can point a bunch of things it's all about just adjusting rotation values based off of an input value so you've got a lot of control in there but we're going to keep it basic today and we're just going to work on controlling on where our character is going to point that pistol so the first thing we're going to want to do is we're going to want to take the aim idle here and we're going to duplicate it and with contrl d and we're going to go AO uncore as the name and move it into the AO file here so this is just a blank folder here that I've just made um and we're going to use this as again the base for all of our AIM offsets now because we do need a bunch of directions but we also need a center we're just going to duplicate it really quickly hit end on our keyboard and just name it to AO C but we also were going to duplicate it again and open it up now the first thing we're going to want to do is we're going to want to look for spine one under the hierarchy and also stop the play and put it at frame zero so make sure you do that first otherwise when you start playing in the timeline it changes the dtls panel so reset it back to spot one and you'll be all good now under the details panel here under the rotation you're going to see a little icon here now this cycle is between local and World space and by default it's at local but if we right or sorry left click this it'll switch it to World space now watch what happens when we do this so we're going to go to the roll here which is on the x value we're just going to click to highlight it press end on our keyboard and we're going to go Plus 90 now as you can see that now it push it in a direct 90° downward angle rather than this kind of angled area that it would have done otherwise if I tried to use the Y value on the spine in local space but now from here all I can do is I can click on key and there we go now we have I uh just go back to the side panel here and I can just go AO down and I'm going to duplicate the AO again and this time we know that that one's down so this next one's going to be up and we'll double double click and open her up and now if we click on spine again if we don't close this window you'll see the rotation is still set to World it keeps the uh settings that you set uh that you select so what we can do is we're going to go back to the x value here go to the end and this time we're going to go minus 90 and you can see it goes again straight back and up go up to key up here at the top and boom save that there we go so now we have Center down up we still need left and right though so we're going to duplicate the AO uncore again and open open up that duplicate sticking with spine one and in World space but this time we're going to go to the Z value which is the blue icon or also the yaw and if we go to the End by pressing end on the keyboard and we're going to go Plus 90 and this time now we got that nice right direction so if we key that position save that go back F2 to rename and on the keyboard to be able to get to the end of this uh of the uh string here and then we go aore R now from here we can just go aore duplicate again and we know this one's going to be l so we'll just go aore L and then open her up go to the spine one keeping it in world going to the Z hitting end minus 90 boom key that save that and there we go so now we have our main directions but we want to make sure it's an eight-way directional because it does provide the smoothest of am offsets so we're going to do is we're going to take the AO um U for up and we're going to duplicate it and we're going to make sure we're still on SP one and we're going to go to the Z value on this one and we're going to go end + 90 and again we know that this is the right side so we're just going to take that save that and we're going to go aore r or aore and then just duplicate the AO uncore U again and do the exact same thing so we go spine and this time we're going to go minus 90 key it at zero and save and this one's going to be AO uncore upper left so now you kind of get the idea we're just kind of duplicating the up and down directions and then adding to the zv value in World space for spine one so we're going to go end then Plus 90 key that save that and we know that this is down right duplicate down again now this one we know is going to be down left so go ahead and open her up go to spine one go to the end and minus 90 key that save that and boom now we have all eight directionals for our aim offset but there's one more step before we can actually use them inside of an aim offset and it's very easy to do we're just going to highlight all of them together so if we take one and then shift select and with the end here we can right click go to asset actions and then we're going to bulk edit via property Matrix now as you can see here we get a bunch of options here but there's only one specific area that we're actually concerned with which is additive settings we want to make sure that the additive is set to mesh space we want to make sure that the the um it's set to selected animation scaled and then the base pose is actually going to be the handgun aim idle so we're going to throw that in there under the Basse pose by I just highlight it here and then click on the little arrow here and it throws it in so now we can just save all go back into our aim offset and we're going to rightclick go to animation and you'll see aim offset here as an option and we're going to need to select our skeleton and for me I'm using the twin Blast from the Paragon assets and a handgun a offset so we'll go handgun AO and we'll open this up all right so the first thing we're going to want to do is take the horizontal axes the horizontal axes is going to be the yaw because this is going to be the direction for left and right and because we set up with the uh the aim offsets directions for 90° we're going to go negative 90 for minimum and 90 For maximum now you can set your AOS up with 45s with whatever you want I just would recommend that whatever you set up the animations for as far as a directional or rotation value I should say you make sure you set this as well so if you go 30 30 the positive 30 you know that's really the only difference I'm trying to make um and if you set them up differently I want something I do recommend sometimes is you can uh set up your left and rights for 90 up and downs for 45 and if that be the case when we get to this next one here we're just going to name it yah and then you would set these instead of to 90 and positive 90 it would be 45 posi 45 but as you can see here now we have this nice grid and we can just start dragging animations in so we got aore C so this is the center now we have aore D for down down left down right and then left and if you hold shift so like if you click on drag and then press shift it'll actually snap it to one of these lines here so it makes it very easy we go up up left and up right now you can see we have a nice very smooth aim offset so we'll go ahead and save that but in order to be able to use this inside of our animation blueprint we do need to give it a uh pitch and yav value to go off of so what we're going to do is grab the asbp third person character or whatever your uh character variable is so this is inside of the animation blueprint doesn't matter what you have if yours is set up like mine generally you will always have this variable and we're going to pull off of it and get two different things we're going to get the active rotation and then we're also going to get the control rotation now this is something I got to give a shout out to Unreal magic uh this one was discovered by uh them over there or him I don't know if it's more than one person or not uh but I was just going across videos I like to see what other people are up to and I came across this way to do it and I've never looked back so what we're going to do though is we're going to pull on the oor rotation and we're going to type in Delta and we're going get the Delta Rotator node because we want to get the Delta between the oor rotation and the control rotation and this way we can right click split this struct pin and now we have pitch and yaw so we're going to right click promote both of these to a variable and now we have our pitch and our yaw so we'll just go ahead and we'll just kind of set these at the end I'm setting this off of um update animation but where you have it in your update animation really doesn't matter I'm just putting it at the end here just to show you guys so we'll compile and save that and then I'll go to My anom Graph base Locomotion and I'll go to my aiming state which right now is consistent of just an aim idle which I'll show you guys right now as you can see I do have a pistol and I can aim it it doesn't do anything doesn't follow any direction right it just kind of raises his arm puts it back down that's it but I want to be able to actually aim in a Direction so we're going to unhook this cuz we still need this we just need something else with it and we're going to search for the handgun AO and we're going to drag this in and hook this up to the output pose take the handgun a idol so the aim idle that we used for the Basse pose um here for the additive settings same animation and then for the pitch and yaw we're going to take the pitch oh it looks like I named them both yaw let me fix that so horizontal should be pitch and vertical axes should be yaw so again horizontal pitch vertical yaw because I apparently messed that up but my bad we will uh we got that fixed now so we're going to plug pitch in a pitch yaw into yaw and then now instead of that static just aiming forward if we click play now draw my pistol all right so uh the reason why it was reversed there for a second is because I right I do this all the time it's control rotation is a actor rotation is B if we compile and save now play grab my pistol you see now it follows perfectly for some reason when you're using the control rotation Delta um and you have the actor rotation and is a and it's getting the B of that then it it reverses everything it's all backwards um originally I was like oh maybe that's just the way it is and I ended up doing a like multiply by ne1 to reverse the value um but come to find out it was just because of the way A and B were that's all so my bad guys um but now that we have that set up so we got again horizontal axis yawn 90 90 vertical axis is pitch positive or negative 90 90 and then we have all of our animations that we just created inside of here nice and smooth and then we're going in able to now utilize them so you can see the character moves exactly where the camera is with a little bit of minor difference at some moments it kind of uh turns its back in a little bit at certain corners but it actually lines up when you uh line your camera up and put crosshairs in it actually lines up really well I use this uh type of system a lot it's just again I I always get those two backwards but that's going to close it out for today's video guys I hope you've enjoyed um you know I apologize for being away for so long we got videos coming out now that I'm back and back in full swing so so make sure to stick around guys and as always stay in at
Info
Channel: Artofficial Entertainment
Views: 1,747
Rating: undefined out of 5
Keywords: Unreal Engine, Unreal, Engine, UE, UE5, Tutorial, Aim, Offset, AO, Shooting, Aiming, Smooth, Animation, Game Dev
Id: 29y-Tp58xBA
Channel Id: undefined
Length: 12min 0sec (720 seconds)
Published: Thu Oct 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.