Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mechanim head look at blend

Discussion in 'Animation' started by petey, May 12, 2014.

  1. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,810
    Hi there,

    I've been having a look around and haven't found a solution for this. Hopefully I'm just not looking right because this surely is a common problem but I was trying to blend some head "lookat" animation on the character's head over the existing animation but I can't seem to do it.

    There's Animator.SetLookPosition but I have no idea how to use it...

    Can someone point me in the right direction here?

    Thanks
    Pete
     
    Last edited: May 12, 2014
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,758
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,629
    Since this uses IK, it requires Unity Pro. It procedurally (i.e., via code) adjusts the head after the state machine's animations have been applied. As StarManta writes, you could also procedurally adjust the head using the HeadLookController script if you don't have Unity Pro. Or buy and use Final IK.

    Or, since you mentioned blends, you could skip IK and blend head motion in a head layer in your animation state machine. IK is generally preferable. But, to do this method, you can create a head layer with a 2D blend tree. Blend on two float parameters, say LookVertical and LookHorizontal. Blend between four animations: look up, look down, look left, and look right. By adjusting the parameters, you can move the head all around.
     
  4. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,810
    Hey thanks guys, I had no idea about Final IK. I'm using my own I'm IK system but that looks pretty intersting.
    I think I'll have a look at the script first and go from there.

    Pete