Looking with upperbody - Aim Offset

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone so today i'm gonna show you how to implement uh this uh aim offset so as you can see when i look up character when i look down character looks down when i look to the left correct also look at that way see so it's like that and if i try to completely turn character just looks forward because the character can't rotate the upper body 180 degrees without turning to that side but if i look up as you can see here character is also looking up so this this also works when i crouch as well so let's see how to implement this and this episode is sponsored by these generous patrons thank you very much for the support you guys are giving me right so at the moment uh when i look to the left or look to the right character don't really turn that character just stay looking forward so i want to if i for example if i look at this way character should turn its head maybe slightly the upper body as well to that pair to look at that way okay so first thing we need to do that aim offset that's it so that's the first thing we need so we can create it if we go to the skeleton of this character right click create aim offset i'll call it hello look okay so for that i have already created this uh imported this aim of animations required for the aim offset so this is the default one and we have this turn left look up look back many forces right so using them we can create a aim offset has it so did i already create one now oh for that we have to go here oh yeah actually he created one here i'll put it under the same offset look okay now let's open it hey oh look right so here and i set this details as the preview base pose let's assign id okay and now ah sorry oh look here i so we need to name this axes and let's name the horizontal axis seo because yo is the what uh angle that we need to change in order to affect that and this one pitch ah now here i'll for the center let's assign ao cc oh where's the character all right before that we need to set the maximum and minimum values so yo that means look to the left and look to the right so as the maxima minimum i'll give you minus 180 as the maximum i give 180 four divisions should be right and for look up and down if so 0 means looking forward looking completely up that means 90 because we can't uh rotate 180 degrees in that alone the pitch around pitch axis so this should be minimum minus 90 maximum 90 right and here we need to give uh let's try idle animation as the preview bass pause now this one this means we are looking 90 degrees to the right so ao rc hey why did this changed let's see it turns this way now this one here means we are turning 180 degrees to the right that means we should be completely looking back but uh for the character it's not possible to do that without turning so therefore if let's say if we look at this way using the camera camera the character should just look forward so we can do it like this if i apply the same cc into here for some reason this keep changing when i add animation here that's why this preview vanishes but let's set it at the end so [Music] this should be lc now the your part it's complete now let's fix these other points so here looking up and here looking down so for that we can use center up and center down okay why does this get highlighted when i select one if i collapse this it looks like a bug right anyway let's complete this cd center down and the other one is right up and right down this is lift up lift down where's the right up this is right down and write up and again this one should be center up aos see you your cd this should be centered on similarly this corner also center down center up now if i change this one back to idle it should be alright see now we have the complete um aim offset asset right okay now let's add this to of animation blueprint where should it go uh let's set it here before the default slot is applied so that if i play some montage it the same offset part will be overwritten which is good alpha i'll keep as one so to test what if i make this one 90 see character is looking that way okay now we need to make this dynamic so for that i'll promote this yo as a parameter do i already have them no and which as a parameter default value should be zero now in the event graph right we have we need a reference to phone and this has already become a mess we need to clean this up okay uh without making this a further mess i'll add a readout node here and another free route node here select both and collapse update ao parameters u stands for aim offset i name this one has the ball right now from this phone upon reference we can get there is a function called get base aim rotation if you go above the tv it shows the tour tip return the am rotation for the pawn so that means uh yeah the ice direction uh by default we aim at the player's eyes direction so when we have a controller assigned for this particular character it will give us the rotation that represents the direction we are looking through the camera and also we can get at the rotation and this basically gives the rotation of the actor and by doing a delta operation between this am rotation and the actor rotation so this uh kind of like a subtraction but um not like for float subtraction basically it gives the difference and we can split this so using the from this difference we can now get access uh pitch and yo differently so using these values i'll set yo and which don't need this part now and compile and save all now let's go here and test see now when i look at this way character turns like this this way character runs like that and if i look up character is looking upward but it's not clear as i'm looking at the face is not visible and if i look down character is looking down like this so if i completely try to turn this way character just looks forward because that's the way we have set up the aim offset if i look up now character is looking up in the forward direction if i look down character is looking down all right so now let's see what happens if we see even if i am working character keep looking at the desired direction like that so okay so with that we can stop this episode right here what if we crouch still it works see great and yeah let's check a situation where a montage is played so by the montage that look at part should be over in let's check so i'll move while see that landing part is played from a montage so when that montage is played character looks forward that's exactly what i want to happen otherwise it would look kind of unrealistic all right let's check the falling down part i said okay when in the regular mode character is not looking and it starts to look at the directions once it stands up all right so with that i would like to stop this episode right here and thanks for watching so the project files will be available for the download through the patreon page link would be in the description below and if you like to support my work you can get the membership of the petrol club thanks for watching see you in another episode goodbye
Info
Channel: CodeLikeMe
Views: 19,972
Rating: undefined out of 5
Keywords: unreal aim offset, unreal head rotation, unreal upperbody rotation, unreal turn with upperbody, unreal looking with upperbody, unreal look at direction, unreal look up and down, unreal look left and right, unreal aim offset head rotation, ue4 aim offset, ue4 head rotation, ue4 upperbody rotation, ue4 turn with upperbody, ue4 looking with upperbody, ue4 look at direction, ue4 look up and down, ue4 look left and right, ue4 aim offset head rotation
Id: ycTptqSRMGg
Channel Id: undefined
Length: 18min 11sec (1091 seconds)
Published: Fri Jan 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.