Aim offset is just an animation which turns characters torso where player is aiming at.
Go to AnimStarterPack and create folder “AimPoses”.
Duplicate Aim_Space_Hip and move it to AimPoses.
In AimPoses duplicate Aim_Space_Hip and rename it as Aim_Center.
Duplicate it 8 more times and rename them to what you see in picture below.
Open Aim_Center. Stop the animation and move the red cursor to zero.
Right click on red cursor and select “Remove from frame 1 to frame 87”.
Open Aim_Center_Down. Move the cursor to frame 20, right click and Remove from 0 to frame 20.
Move cursor to zero and select Remove from frame 1 to frame 68.
Select all Aim animations.
Right click them and do Asset Actions -> Bulk Edit via Property Matrix.
In AdditiveSettings set Additive Anim Type to Mesh Space.
Change Base Poses Type to Selected animation frame.
Set the animation asset…
Find the ue4 mannequin skeleton.
Right click it and do Create -> Aim Offset.
Change the Axis Settings…
Drag and drop Aim_Center to center of axis lines.
Aim_Center_Up goes to center top.
Aim_Center_Down goes to center bottom.
Change Preview Base Pose to Idle_Rifle_Hip.
Go to Animation Blueprint.
Go to AnimGraph.
Drag and drop AimOffset.
Add variables to AimOffset node.
Go to EventGraph.
Right click somewhere and type this, it will give you reference to self.
Then assign it to a variable.
Now you select the variable.
And copy it.
Then go to Character, paste and right click. Select Create variable. And compile.
Now go back to animation blueprint and find Cast To Ue4ASP_Character and from it get the variable you just added into Character. This will set the variable in Animation blueprint.
Also delete variable Ue4CharacterAnim from animation blueprint so you don’t mess up them with Character variable.
Go to Character and create all this.
- AimOffsetYaw and AimOffsetPitch are replicated.
- InputAxisTurn and InputAxisTurn are Run on Server and not Reliable.
- Disableshooting variable stops shooting if character turns too much.
In animation blueprint you have to get the values from Character so you do this.