Search Unity

How to obtain the target position of a bone for IK

Discussion in 'Animation' started by rahimaga, Apr 12, 2021.

  1. rahimaga

    rahimaga

    Joined:
    Mar 25, 2019
    Posts:
    8
    Hi,

    I would like to know how to obtain the target position of a bone in the current state or in blending states.
    I mean the position the bone should have by the animator, not the real position of the transform.
    For IK I want to calculate the collisions applying the position that the bone should have.
    Is there any way to get the position?

    Thanks for your time
     
  2. launzone

    launzone

    Joined:
    Dec 2, 2015
    Posts:
    57
    in OnAnimatorIK() you can do:
    Code (CSharp):
    1. animator.GetIKPosition (AvatarIKGoal.LeftHand);
    for example