My setup:
I am working on a third-person shooter project. I use mixamo animations for movement (lower body parts) and have the upper body animated separately using avatar mask, with custom animation for each weapon. I was also trying to use IK for attaching the weapon, but both, unity’s built-in IK and anim rigging IK didn’t give satisfying results.
The problem:
For Recoil, I am trying to move the gun and the hands a bit backwards and rotating it slightly in a random direction(Gun is child of the hand bone). For this I am using the override transform constraint of the animation rigging package, but for some reason it only applies rotation and to position to the hand.
Position weight and rotation weight are both set to 1, space is set to pivot. The Constrained object is the right hand bone and the override source is the recoil transform. I also tried using a two-bone IK constraint instead, but that messes up the hand and weapon position, since the object that the recoil is applied to would need to be a child of the hand, in order to get moved correctly when the character is aiming up and down. Up and down aiming is achieved with a blend tree, blending between a 'Face upwards, ‘face forward’ and a ‘face downwards’ pose.