# GetMeshWeightings(float[])

> Gets the array of Mesh weightings to use when randomly selecting particle meshes.

## Definition

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

```csharp
public int GetMeshWeightings(float[] weightings)
```

### Parameters

**** (\[float\[]]\(https\://learn.microsoft.com/dotnet/api/system.single)): An array this function populates with the list of Mesh weightings the ParticleSystemRenderer uses for particle Mesh selection. If the array is smaller than the number of weights, this function cannot populate it with every weight. If the array is larger than the number of weights, this function ignores indices greater than the number of weights. Use [ParticleSystemRenderer.meshCount](/engine/6000.3/script-reference/unityengine/particlesystemrenderer/meshcount.md) to get the number of Meshes, and thus weights, the ParticleSystemRenderer has.

### Returns

| Type                                                       | Description                                                         |
| ---------------------------------------------------------- | ------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of weights this function wrote to the destination array. |

### Remarks

Additional Resources: [ParticleSystemRenderer.meshDistribution](/engine/6000.3/script-reference/unityengine/particlesystemrenderer/meshdistribution.md).
