Search Unity

IK is not working even IK pass was enabled

Discussion in 'Animation' started by haqan, May 28, 2022.

  1. haqan

    haqan

    Joined:
    Jun 7, 2015
    Posts:
    2
    Code (CSharp):
    1.     private void OnAnimatorIK(int layerIndex)
    2.     {    
    3.         Debug.Log("look");
    4.         anim.SetLookAtWeight(1, 1, 1, 1, 1);        
    5.         anim.SetLookAtPosition(InputHandler.instance.state.transform.position + Vector3.up);
    6.     }
    debug is working. but ik is definetly not. what can be the problem
    ik pass enabled and the models are humanoid
     
  2. haqan

    haqan

    Joined:
    Jun 7, 2015
    Posts:
    2
    bruh... i just found a solution the problem is last parameter of the setlookatweight if its 1 its not work...
     
    akuno likes this.
  3. akuno

    akuno

    Joined:
    Dec 14, 2015
    Posts:
    88
    Thank you so much!
    I had it set to 1, and was actually working on v2019.4, then I switched to v2022.1 and it stopped working. You saved me some hours of debugging :)