---
title: ProjectRootTranslation(float3, quaternion, bool)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/rootmotionutility/projectroottranslation
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/rootmotionutility/projectroottranslation.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:22:41.179Z
locale: en-us
---

# ProjectRootTranslation(float3, quaternion, bool)

> Projects a root translation onto the ground, which is the horizontal plane at y = 0.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

```csharp
public static float3 ProjectRootTranslation(float3 translation, quaternion rotation, bool bankPivot)
```

### Parameters

**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): The root translation to project onto the ground.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The root rotation. When `bankPivot` is `true`, its up axis is the projection direction.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to project along the up axis of `rotation` instead of downward.

### Returns

| Type                                                                  | Description                                     |
| --------------------------------------------------------------------- | ----------------------------------------------- |
| [float3](/engine/7000.0/script-reference/unity/mathematics/float3.md) | The projected translation, with a y value of 0. |

### Remarks

Use this method to find the ground position of a bone when you match clips during a transition. The bone doesn't have to be the top of the hierarchy. For example, project the hips to align a walk clip with a jog clip.

If `bankPivot` is `false`, the method projects the translation straight down and ignores the rotation of the bone. If it is `true`, the method takes the rotation into account and projects the translation along the up axis of `rotation`, unless that axis is horizontal. A horizontal axis makes the projection impossible, so the method projects downward instead.

The following example uses the `Unity.Animations` and `Unity.Mathematics` namespaces. It projects the hips of a walk clip and a jog clip onto the ground, then computes the offset that aligns the jog with the walk.

### Examples

```csharp
// This example aligns a jog clip with a walk clip during a transition, using the hips as the matching bone.
// It returns the horizontal offset to add to the jog so that the jog hips are above the same ground position
// as the walk hips.
public static float3 ComputeAlignmentOffset(
    float3 walkHipsTranslation,
    quaternion walkHipsRotation,
    float3 jogHipsTranslation,
    quaternion jogHipsRotation,
    bool bankPivot)
{
    // Project the hips of each clip onto the ground. With bankPivot set to true, the projection follows the up
    // axis of the hips rotation, so tilted hips shift the ground position horizontally. With bankPivot set to
    // false, the projection goes straight down.
    float3 walkGroundPosition =
        RootMotionUtility.ProjectRootTranslation(walkHipsTranslation, walkHipsRotation, bankPivot);
    float3 jogGroundPosition =
        RootMotionUtility.ProjectRootTranslation(jogHipsTranslation, jogHipsRotation, bankPivot);

    // Both ground positions are on the ground plane, so the offset is horizontal.
    return walkGroundPosition - jogGroundPosition;
}
```
