I’m creating a relative transform from of my character’s gun sight relative to the character’s hand_r bone. In my anim graph, I use the Transform (modify) Bone node to transform a virtual bone using this transform in bone space. The virtual bone is tracking the hand_r bone and is parented to the head bone.
I then draw a sphere to represent the virtual bone. At first all is well and the sphere is drawn in the correct location, but when I move around and use the aim offsets, the bone location becomes incorrect slightly. If I go back to the base pose (no offsets), it calculates the correct position again. The more extreme the offset, the more invalid the bone location.
I have verified the relative transform between the sight and the right hand never changes. Something is going wrong when I apply the transform to the Transform Bone node. I can’t figure out what is causing the issue, but it’s off enough to really mess with my aim down sights system when using aim offsets.
The blue sphere represents the virtual bone I’m manipulating.
When no aim offsets are being used, it works as intended:
But when aim offsets are being used, the bone is moved slightly to the right:
I have tried other parent bones and different bone spaces and nothing seems to solve it. I’m thinking this might have something to do with how the aim offsets affect the bone values when blending animations, but not sure.
Any ideas?