Animation Rigging IK

  • Whenever a Playable is connected to its PlayableGraph, any IK targets used by Unity's Animation Rigging package are reset to their starting positions.
    • After a new AnimancerNode is created its Playable needs to be connected for it to be played.
    • Generic Rigs keep their Playables connected so this reset only happens when a new animation is first played.
    • Humanoid Rigs disconnect their Playables when the AnimancerNode.Weight is 0, so this reset happens every time an animation is played.
  • Simply storing the positions of the IK targets and re-applying them after the reset doesn't properly solve the issue because the IK seems to entirely stop working during that frame. So even though they keep their positions, you still get one frame of the model without any IK applied.
  • The only know workaround is to force Animancer to create all the states you might need on startup and keep them connected:
  1. If your Rig is Humanoid, set animancer.Playable.KeepChildrenConnected = true;. If your Rig is Generic, it will already be true by default so you can skip this step.
  2. Call animancer.Layers[0].GetOrCreateState(...); for every animation (yes, this is very inconvenient).