Table of Contents

Class HumanoidBones

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

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

animator Animator

The model's animator. Null, or one with no humanoid avatar, finds nothing.

searchRoot Transform

Where to look for the named bone; the animator's own transform when null.

bone HumanBodyBones

The 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

parent Transform
name string

Returns

Transform