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

# ComputeLocalToWorldLinearVelocities

> Computes the linear velocity of each bone in world space, from two consecutive streams of the same rig.

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

## ComputeLocalToWorldLinearVelocities(float4x4, float4x4, AnimationStream, AnimationStream, float, NativeArray\<float3>)

```csharp
public static void ComputeLocalToWorldLinearVelocities(float4x4 localToWorld, float4x4 previousLocalToWorld, ref AnimationStream input, ref AnimationStream previousInput, float deltaTime, NativeArray<float3> outVelocities)
```

### Parameters

**** (\[float4x4]\(/engine/7000.0/script-reference/unity/mathematics/float4x4)): The `LocalToWorld` matrix of the character at the time of `input`.**** (\[float4x4]\(/engine/7000.0/script-reference/unity/mathematics/float4x4)): The `LocalToWorld` matrix of the character at the time of `previousInput`.**** (\[AnimationStream]\(/engine/7000.0/script-reference/unity/animations/animationstream)): The stream for the current update.**** (\[AnimationStream]\(/engine/7000.0/script-reference/unity/animations/animationstream)): The stream for the previous update. It must use the same rig as `input`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The time between the two streams, in seconds. It must not be zero.**** (\[NativeArray\<float3>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): Receives the velocity of each bone, in units per second. The length must be equal to the bone count of the rig.

### Remarks

The velocity of a bone is the change of its world position between the two streams, divided by the elapsed time. The world position of a bone is its `LocalToCharacter` translation transformed by the `LocalToWorld` matrix.
