Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why OnAnimatorIK is not working properly?

Discussion in 'Animation' started by KaitoKid07, Jun 2, 2022.

  1. KaitoKid07

    KaitoKid07

    Joined:
    Jun 2, 2022
    Posts:
    2
    Hello there,

    I am just trying to get this working, but it is not being called by Unity.

    private void OnAnimatorIK(int layerIndex)
    {
    Debug.Log("OnAnimatorIK");

    }

    the c#~script is on the same component where the animator is. I tested it out using Unity 2021, 2022 and it is not working yet. (different Humanoid avatars)

    Just created a simple scene, with no more logic, just an animator, avatar and this c# script and not working yet.
    Any suggestion or advice? Thanks for your time.
     
  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    203
    Did you enable the IK Pass in your layer in the animator controller?
    upload_2022-6-2_21-38-34.png
     

    Attached Files:

  3. KaitoKid07

    KaitoKid07

    Joined:
    Jun 2, 2022
    Posts:
    2
    Oh, Thank you.

    I did it at the animation level (see the image), marking Foot IK. I thought that was enough, but I was wrong.
    upload_2022-6-2_18-21-57.png

    It is working now. Thanks again.
    upload_2022-6-2_18-23-23.png
     
    MarekUnity likes this.
  4. Recluse

    Recluse

    Joined:
    May 16, 2010
    Posts:
    485
    I have this issue since updating to Unity 2021.2.14f1. It affects all projects and OnAnimatorIK no longer works. And yes, IK pass is enabled in base layer.