RootMotionBoneId
The identifier of the bone whose motion gives the root motion of a clip.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Property
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
public StringHash RootMotionBoneId { get; readonly set; }
Remarks
By default, the value isn't set: it is the default , and the root motion bone is the root bone of the skeleton. Set it to choose another bone, for example a hips bone under a root that clips don't animate. The identifier of a bone is the StringHash of its path relative to the root of the hierarchy, for example . Set the default to go back to the root bone. RigBuilder.Clear also resets the value to the default.
StringHashrigBuilder.RootMotionBoneId = "Skeleton/Hips"StringHashRigBuilder.ToRigDefinition stores the index of the bone in RigDefinition.RootMotionBoneIndex. When a clip has no root motion curves, ClipSampler.SampleRootMotion returns the motion of this bone in character space, which includes the motion of its parent bones. ClipSampler.SampleExtractingRootMotion removes the root motion from this bone in the pose.
Add the bone before you set this value. If safety checks are enabled, setting it throws an when no bone of the skeleton has this identifier, and throws one when you removed the bone afterward.
ArgumentExceptionToRigDefinition