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); `