<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/SampledAnimation/SkeletalAnimationOperation/extractRootMotion(jointName:options:lockPosition:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation16SampledAnimationVA2A15JointTransformsVRszrlE08SkeletalD9OperationV17extractRootMotion9jointName7options12lockPositionAGyAE_GSS_AG0jK7OptionsVyAE__GAA9TransformVSgtFZ"
  },
  "title" : "extractRootMotion(jointName:options:lockPosition:)"
}
-->

# extractRootMotion(jointName:options:lockPosition:)

Extracts root motion from the specified joint.

```
static func extractRootMotion(jointName: String, options: SampledAnimation<Value>.SkeletalAnimationOperation.RootMotionOptions = .translationXZ, lockPosition: Transform? = nil) -> SampledAnimation<Value>.SkeletalAnimationOperation
```

## Parameters

`jointName`

Name of the joint to extract root motion from.

`options`

Transform components to extract.

`lockPosition`

Position to lock the root joint to after extraction.

## Return Value

A [`SampledAnimation.SkeletalAnimationOperation`](/documentation/RealityKit/SampledAnimation/SkeletalAnimationOperation) that, when processed, produces an [`AnimationGroup`](/documentation/RealityKit/AnimationGroup)
containing both the modified skeletal animation and the extracted transform sampled animation
used for root motion.

## Discussion

Removes the specified transform components from the joint and returns them as a separate
`SampledAnimation<Transform>` in the resulting [`AnimationGroup`](/documentation/RealityKit/AnimationGroup). The skeletal animation
will have the extracted motion removed. The returned `SampledAnimation<Transform>` has
[`bindTarget`](/documentation/RealityKit/SampledAnimation/bindTarget) set to [`BindTarget.rootMotion`](/documentation/RealityKit/BindTarget/rootMotion) automatically — playing the
group drives the entity’s root motion and emits [`AnimationEvents.RootMotionDidUpdate`](/documentation/RealityKit/AnimationEvents/RootMotionDidUpdate) events.

When you extract root motion, the function returns an [`AnimationGroup`](/documentation/RealityKit/AnimationGroup) containing both the
skeletal animation and the root motion animation. Playing back this group triggers root motion
events in sync with the skeletal animation. The event callback receives the delta transform
moved between the last frame and the current frame. If no event handler subscribes to the root
motion on the target entity, the system automatically applies the delta to the entity’s transform.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)