---
title: ComputeBlendSpace1DWeights(float, NativeArray<float>, bool, float, float, NativeArray<float>)
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/blendspaceutility/computeblendspace1dweights
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/blendspaceutility/computeblendspace1dweights.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:26:21.442Z
locale: en-us
---

# ComputeBlendSpace1DWeights(float, NativeArray<float>, bool, float, float, NativeArray<float>)

> Compute 1D blend space weights given an input, wrap information and animation stream values.

## 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 void ComputeBlendSpace1DWeights(float input, NativeArray<float> values, bool wrap, float min, float max, NativeArray<float> outWeights)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The input value to convert into weights, in the same space as `values`.**** (\[NativeArray\<float>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The blend space value of each animation stream, in ascending order. The method doesn't check the order, and returns incorrect weights if the values aren't sorted.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If `true`, the input wraps between `min` and `max`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The lower bound of the wrap range. The method uses it only if `wrap` is `true`.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The upper bound of the wrap range. The method uses it only if `wrap` is `true`.**** (\[NativeArray\<float>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The array that receives the weight of each animation stream. Its length must equal the length of `values`.

### Remarks

When `wrap` is `true`, the method first wraps the input into the range from `min` to `max`. An input outside the range that `values` covers then blends between the last and the first animation across the edge of the range. When `wrap` is `false`, an input beyond the first or last value gives that animation a weight of 1.

If `values` is empty, the method doesn't write to `outWeights`.
