FindBoneIndex(StringHash)
Finds the index of the bone with an identifier.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
public int FindBoneIndex(StringHash id)
Parameters
The identifier of the bone to find.
StringHashReturns
Type | Description |
|---|---|
| int | The index of the bone in Skeleton.Ids. If no bone has the identifier, returns |
Remarks
For a rig built from transforms or an Avatar, the identifier of a bone is the StringHash of its path relative to the root. For example, finds the bone at that path. The method searches the bones linearly. For details, refer to BindingUtility.FindBindingIndex.
FindBoneIndex(new StringHash("Hips/Spine"))