# GetTrails

> Returns all the data relating to the current internal state of the Particle System Trails.

## Definition

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

## GetTrails()

Returns all the data relating to the current internal state of the Particle System Trails.

```csharp
public ParticleSystem.Trails GetTrails()
```

### Returns

| Type                                                                           | Description                                                                             |
| ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- |
| [Trails](/engine/6000.0/script-reference/unityengine/particlesystem/trails.md) | The variable to populate with the Trails that currently belong to the Particle System.. |

### Remarks

If you want to restore the Particle System to its current state in the future, store the Trails this function returns along with [ParticleSystem.GetParticles](/engine/6000.0/script-reference/unityengine/particlesystem/getparticles.md) and [ParticleSystem.GetPlaybackState](/engine/6000.0/script-reference/unityengine/particlesystem/getplaybackstate.md).

Additional Resources: [ParticleSystem.Trails](/engine/6000.0/script-reference/unityengine/particlesystem/trails.md), [ParticleSystem.SetTrails](/engine/6000.0/script-reference/unityengine/particlesystem/settrails.md), [ParticleSystem.GetPlaybackState](/engine/6000.0/script-reference/unityengine/particlesystem/getplaybackstate.md).

## GetTrails(Trails)

If you want to restore the Particle System to its current state in the future, store the Trails this function returns along with [ParticleSystem.GetParticles](/engine/6000.0/script-reference/unityengine/particlesystem/getparticles.md) and [ParticleSystem.GetPlaybackState](/engine/6000.0/script-reference/unityengine/particlesystem/getplaybackstate.md).

This method allows you to get the trail data without creating any garbage, if you presize the trail data.

Additional Resources: [ParticleSystem.Trails](/engine/6000.0/script-reference/unityengine/particlesystem/trails.md), [ParticleSystem.SetTrails](/engine/6000.0/script-reference/unityengine/particlesystem/settrails.md), [ParticleSystem.GetPlaybackState](/engine/6000.0/script-reference/unityengine/particlesystem/getplaybackstate.md).

```csharp
public int GetTrails(ref ParticleSystem.Trails trailData)
```

### Parameters

**** (\[Trails]\(/engine/6000.0/script-reference/unityengine/particlesystem/trails)): The current Trails belonging to the Particle System.

### Returns

| Type                                                       | Description           |
| ---------------------------------------------------------- | --------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of trails. |
