Class HumanoidBones
Finds a humanoid model's bones by its avatar's own map of them.
public static class HumanoidBones
- Inheritance
-
HumanoidBones
- Inherited Members
Remarks
Read from the avatar's human description rather than UnityEngine.Animator.GetBoneTransform(UnityEngine.HumanBodyBones), which answers null until the Animator is initialised, and one with no controller and no graph yet is not. CharacterBody finds the feet it sets on the ground this way, and anything that rides a bone (a buff effect at the ankles) asks the same question the same way, so the two can never disagree about where a foot is.
Methods
Find(Animator, Transform, HumanBodyBones)
The transform the avatar maps to bone, searched for under searchRoot.
public static Transform Find(Animator animator, Transform searchRoot, HumanBodyBones bone)
Parameters
animatorAnimatorThe model's animator. Null, or one with no humanoid avatar, finds nothing.
searchRootTransformWhere to look for the named bone; the animator's own transform when null.
boneHumanBodyBonesThe human bone wanted.
Returns
- Transform
The bone, or null when the model does not map it.
Named(Transform, string)
The first transform named name at or under parent, depth first.
public static Transform Named(Transform parent, string name)
Parameters
parentTransformnamestring
Returns
- Transform