# GetBoneWeights(List<BoneWeight>)

> Gets the bone weights for the Mesh.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.3/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void GetBoneWeights(List<BoneWeight> boneWeights)
```

### Parameters

**** (\[List\<BoneWeight>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): A list of [BoneWeight](/engine/6000.3/script-reference/unityengine/boneweight.md) structs to populate.

### Remarks

Use this method instead of [Mesh.boneWeights](/engine/6000.3/script-reference/unityengine/mesh/boneweights.md) if you want to avoid allocating a new array with every access.

The [BoneWeight](/engine/6000.3/script-reference/unityengine/boneweight.md) at each index corresponds to the vertex with the same index if this mesh has bone weights defined. Otherwise the list will be empty.

Note that this property uses [BoneWeight](/engine/6000.3/script-reference/unityengine/boneweight.md) structs, which represent exactly 4 bone weights per vertex. The newer [BoneWeight1](/engine/6000.3/script-reference/unityengine/boneweight1.md) struct describes a single bone weight, and it can be used with the associated [Mesh.GetAllBoneWeights](/engine/6000.3/script-reference/unityengine/mesh/getallboneweights.md), [Mesh.SetBoneWeights](/engine/6000.3/script-reference/unityengine/mesh/setboneweights.md) and [Mesh.GetBonesPerVertex](/engine/6000.3/script-reference/unityengine/mesh/getbonespervertex.md) APIs to describe up to 255 bone weights per vertex. It is preferable to use [BoneWeight1](/engine/6000.3/script-reference/unityengine/boneweight1.md) and its associated APIs; they offer more flexibility, and might result in small performance benefits as Unity does not have to perform unnessary conversion operations.

Additional Resources: [Mesh.boneWeights](/engine/6000.3/script-reference/unityengine/mesh/boneweights.md), [Mesh.GetAllBoneWeights](/engine/6000.3/script-reference/unityengine/mesh/getallboneweights.md), [Mesh.SetBoneWeights](/engine/6000.3/script-reference/unityengine/mesh/setboneweights.md), [Mesh.GetBonesPerVertex](/engine/6000.3/script-reference/unityengine/mesh/getbonespervertex.md), [ModelImporter.maxBonesPerVertex](/engine/6000.3/script-reference/unityeditor/modelimporter/maxbonespervertex.md), [QualitySettings.skinWeights](/engine/6000.3/script-reference/unityengine/qualitysettings/skinweights.md), [SkinnedMeshRenderer.quality](/engine/6000.3/script-reference/unityengine/skinnedmeshrenderer/quality.md).
