Animation Blueprint
In this section you will find out how to set up the animation blueprint
Last updated
In this section you will find out how to set up the animation blueprint
Last updated
To get the system working, you need to set up the IK system. The idea is simple - hands IK targes are parented to the WeaponPivot bone, which is modified by the recoil. As a result, arms will be animated.
The bone hierarchy is the following:
VB WeaponPivot -> targets head bone
VB hand_r -> targets right hand
VB hand_l -> targets left hand
Tip: make sure that the head/neck bone is not scaled! This might happen when you "hide" the head mesh by using the SkeletalMeshComponent function HideBoneByName - it will reduce the scale of the bone, which will lead to incorrect results!
Solution A: parent the VB WeaponPivot and its children to the root bone.
Solution B: if you need to hide the head bone, try using an invisible material for it.
Add these nodes at the end of your animation blueprint:
Node settings:
For VB WeaponPivot select the hand_r as a Source bone, we will fix it later so it's aligned with the weapon's physical pivot.
Now you need to add the RecoilAnimation node after the retargeting nodes:
Node settings:
Bone to Modify - bone to be modified by recoil.
Axes Order - defines how recoil axes will be applied. By default, the recoil uses XYZ order.
Translation/Rotation Scale - multipliers for each rotation/translation axis.
Translation/Rotation Space - similar to Transform Modify Bone.
Translation/Rotation - recoil values. Only used when Use Auto Update is false.
Select the VB WeaponPivot, Component Space, and YXZ order.
For IK you can use FABRIK or Two Bone IK nodes - there's no a big difference. Let's use Two Bone IK in this example:
Select hand_r as an IKBone, and VB hand_r as an Effector Target:
At this point the animation setup is complete - now it's time to find out more about curves and how recoil works.