Why Animator.GetBoneTransform returns null


I have an animator with configured humanoid avatar.

I’m trying to get position of hand with

Animator thisAnimator = GetComponent<Animator> ();
Transform temp = thisAnimator.GetBoneTransform (HumanBodyBones.RightHand);
Debug.Log (temp);

It always returns null. I checked it with other bones but result is the same.

Did you check “Optimize Game Objects” on the model? If so you need to expose to bone you want to use this on.

There is a collapsed field called “Extra Transforms To Expose” in the Rig Import settings check the ones you want to use, and should work fine.