Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

LookAt IK broken in beta 20?

Discussion in 'Unity 5 Pre-order Beta' started by Seith, Jan 21, 2015.

  1. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hello all, this is a line of code that sets the lookAt weights (body, head, eyes, etc...) on an Animator and works perfectly in 4.6:

    Code (CSharp):
    1. Player.animationScript.playerAnimator.SetLookAtWeight(1f, 1f, 1f, 1f, .5f);
    However it does not work in 5b20. There is no IK being applied at all. I tried placing it in an Update() or LateUpdate() method to no avail. Can someone please confirm this is a bug?
     
    Last edited: Jan 21, 2015
  2. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    (Just in case I submitted a bug report: #665453)
     
  3. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Works for me. Do you have a lookatposition applied?
     
  4. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, I do a SetLookAtPosition() just before. And I triple-checked that the position is a valid one. What puzzles me is that again this code was working flawlessly in 4.6.

    So to summarize I have:

    - A SetLookAtPosition() to set the lookAt position.
    - A SetLookAtWeight() to make sure the proper weight is applied.
    - A visual confirmation that the lookAt position is valid.
    - Several debug outputs which confirm that the weight is properly set.

    And yet despite this the character is not reacting to the lookAt at all. But since you seem to confirm that it in fact works correctly: did you have to change anything in your character's rig somehow?

    Meanwhile I'm going to keep looking through my code to find any mistake that could cause this behavior...
     
  5. Tinovdk

    Tinovdk

    Joined:
    Nov 28, 2013
    Posts:
    83
    Did you enable the 'IK Pass' in the animation layer of the humanoid's animator window?
     
  6. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, I made sure the IK Pass checkbox is checked in the Base layer (it's the only one) of the character's animator.
     
  7. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I also notice that there is no GetLookAtWeight() in the API. How are you supposed to query the actual current lookAt weight, other than checking the value that you pass it on?