OnAnimatorIK() stopped working after Unity update

After updating to Unity 2021.2.2f1…

Humanoid characters no longer look at things.

Animators have IK pass and looking is implemented using OnAnimatorIK() and animator.SetLookAtPosition, animator.SetLookAtWeight.

This occurs in all projects.

After reinstalling Unity 2020 LTS - no problems, animator IK works as usual.

Is there a known bug? Has implementation changed?

I’m experiencing this issue on models which use the animation rigging system. In fact, after removing it from a character, there seems to be vestigial hurdles stopping onanimatorik from working. onanimatorik only works on the character I’ve never applied the animation rigging system to.

Also experiencing this issue.

OnAnimatorIK is being executed and then calls SetLookAtWeight and then SetLookAtPosition, this code worked fine in Unity 2019.

I did have animation rigging installed but I have since removed and it the problem still persists.

Any ideas?

Still a problem, blocking my project. Why doesn’t IK work since updating???

@Recluse I checked it on my side and OnAnimatorIK and SetLookAtPosition works fine. Maybe there is something in your setup that triggers a bug. Can you submit a bug report?

I made a couple of changes to my IK script :

changed OnAnimatorIK() to OnAnimatorIK(int layerIndex)

this didn’t seem to have any effect.

Then I swapped the order so LookAtPosition is set before LookAtWeight in the IK callback.

Suddenly, the script worked again.
Weirdly, swapping the order of the position and weight back again didn’t make any difference, so I am left without any real clue.

I attach the script if you want to take a look.

Oh, and just to confirm - IK pass was enabled at all times in the Animator.

8211468–1071831–IKLookAt.cs (2.22 KB)

@Recluse OnAnimatorIK(int layerIndex) is the correct overload that you should be using.

I checked your script and don’t see anything wrong with it. For readability it’s better to use proper code tags . The order in which you Do I understand correctly that it’s working fine now?