---
title: ComputeLocalToCharacter
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/core/computelocaltocharacter
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/core/computelocaltocharacter.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:20:32.499Z
locale: en-us
---

# ComputeLocalToCharacter

> Compute matrices in LocalToCharacter space with the specified offset. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter.

## 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)

## ComputeLocalToCharacter(AnimationStream, AffineTransform, NativeArray\<AffineTransform>)

Compute matrices in LocalToCharacter space with the specified offset. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter.

```csharp
public static void ComputeLocalToCharacter(ref AnimationStream stream, AffineTransform offset, NativeArray<AffineTransform> outMatrices)
```

### Parameters

**** (\[AnimationStream]\(/engine/7000.0/script-reference/unity/animations/animationstream)): Animation stream**** (\[AffineTransform]\(/engine/7000.0/script-reference/unity/mathematics/affinetransform)): An extra offset which applies to all matrices**** (\[NativeArray\<AffineTransform>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): Resulting matrix computation. This array must be preallocated with the same bone count specified by the RigDefinition.

## ComputeLocalToCharacter(AnimationStream, AffineTransform, NativeArray\<AffineTransform>, AffineTransform, NativeArray\<AffineTransform>)

Compute two sets of matrices in LocalToCharacter space with specified offsets. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter. This method is used to conveniently compute the LocalToCharacter and LocalToWorld matrices of an AnimationStream in one pass.

```csharp
public static void ComputeLocalToCharacter(ref AnimationStream stream, AffineTransform offset1, NativeArray<AffineTransform> outMatrices1, AffineTransform offset2, NativeArray<AffineTransform> outMatrices2)
```

### Parameters

**** (\[AnimationStream]\(/engine/7000.0/script-reference/unity/animations/animationstream)): Animation stream**** (\[AffineTransform]\(/engine/7000.0/script-reference/unity/mathematics/affinetransform)): An extra offset which applies to all matrices in outMatrices1**** (\[NativeArray\<AffineTransform>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): Resulting matrix computation using offset1. This array must be preallocated with the same bone count specified by the RigDefinition.**** (\[AffineTransform]\(/engine/7000.0/script-reference/unity/mathematics/affinetransform)): An extra offset which applies to all matrices in outMatrices2**** (\[NativeArray\<AffineTransform>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): Resulting matrix computation using offset2. This array must be preallocated with the same bone count specified by the RigDefinition.
