Documentation

Unity Engine

Download Unity

Unity Engine

GetBoneIndex(StringHash)

Finds the index of the skeleton node that has an identifier.
Read time 1 minuteLast updated 4 hours ago

Definition

public int GetBoneIndex(StringHash id)

Parameters

The SkeletonNode.Id of the node to find.

Returns

Type

Description

intThe index of the node. If no node has the identifier, returns
-1
.

Remarks

The index is the bone index in the RigDefinition that RigBuilder.ToRigDefinition creates. Use it to set the SkeletonNode.ParentIndex of a node from the identifier of its parent. The method searches the nodes linearly, like Skeleton.FindBoneIndex does on a rig definition.