Transform RootMotion { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RootMotion property of the SkinnedModelRenderer class provides access to the root motion transform of the skinned model. This transform represents the movement of the root bone, which can be used to apply motion to the entire model based on animations.

Usage

Use the RootMotion property to retrieve or set the transform that represents the root motion of the skinned model. This is particularly useful when you want to apply the root motion calculated from animations to the model's position in the scene.

Example

// Example of accessing the RootMotion property
SkinnedModelRenderer renderer = new SkinnedModelRenderer();
Transform rootMotionTransform = renderer.RootMotion;

// Example of setting the RootMotion property
Transform newRootMotion = new Transform();
renderer.RootMotion = newRootMotion;