Inverse Kinematics with Moving GameObject

Currently, we are integrating a bicycle into our application. Using the mecanim system, we can easily use IK such that a character will keep its hands on the handlebar and its feet on the pedals. However, when using SetIKPosition, there is a transition from the character’s current IK goal to the new one. Usually, this is a very nice feature since, it moves the body part smoothly to the target. But since the goalPosition moves with the bike’s game object, the limbs will fall behind because the transition cannot keep up. I.e. increasing the bike’s velocity increases the distance between the goal and the bodypart.

Is there a way to increase the transition speed or to skip the transition altogether? (The position weight is always set to 1.)

I already tried compensating this effect by adding the rigidbody’s velocity vector to the goal position, but that will move the limbs too far.

`
animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 1.0f);
animator.SetIKPosition(AvatarIKGoal.LeftHand, leftHandPositionTarget + rigidbody.velocity);
`

We solved the problem! In case anybody comes across the same problem, here is the solution: The problem is not due to any IK transition. The IK goal positions were set within FixedUpdate(), but since Unity’s physics update comes after FixedUpdate(), the bike was moved to a new location by the physics simulation while the IK goals were set to the old positions. By setting the position in Update(), it works like intended.