# SetParticlesAndTrails

> Sets the particles and the trails of this Particle System.

## Definition

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

## SetParticlesAndTrails(Particle\[], Trails, int, int)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(ParticleSystem.Particle[] particles, ParticleSystem.Trails trailData, int size, int offset)
```

### Parameters

**** (\[Particle\[]]\(/engine/6000.5/script-reference/unityengine/particlesystem/particle)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements in the particles array that Unity should write to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The location in the particle array to start assigning particles. For example, set the value to 4 to assign particles starting with the 4th particle in the array.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).

## SetParticlesAndTrails(Particle\[], Trails, int)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(ParticleSystem.Particle[] particles, ParticleSystem.Trails trailData, int size)
```

### Parameters

**** (\[Particle\[]]\(/engine/6000.5/script-reference/unityengine/particlesystem/particle)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements in the particles array that Unity should write to the Particle System.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).

## SetParticlesAndTrails(Particle\[], Trails)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(ParticleSystem.Particle[] particles, ParticleSystem.Trails trailData)
```

### Parameters

**** (\[Particle\[]]\(/engine/6000.5/script-reference/unityengine/particlesystem/particle)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).

## SetParticlesAndTrails(NativeArray\<Particle>, Trails, int, int)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(NativeArray<ParticleSystem.Particle> particles, ParticleSystem.Trails trailData, int size, int offset)
```

### Parameters

**** (\[NativeArray\<Particle>]\(/engine/6000.5/script-reference/unity/collections/nativearray1)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements in the particles array that Unity should write to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The location in the particle array to start assigning particles. For example, set the value to 4 to assign particles starting with the 4th particle in the array.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).

## SetParticlesAndTrails(NativeArray\<Particle>, Trails, int)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(NativeArray<ParticleSystem.Particle> particles, ParticleSystem.Trails trailData, int size)
```

### Parameters

**** (\[NativeArray\<Particle>]\(/engine/6000.5/script-reference/unity/collections/nativearray1)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of elements in the particles array that Unity should write to the Particle System.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).

## SetParticlesAndTrails(NativeArray\<Particle>, Trails)

Sets the particles and the trails of this Particle System.

```csharp
public void SetParticlesAndTrails(NativeArray<ParticleSystem.Particle> particles, ParticleSystem.Trails trailData)
```

### Parameters

**** (\[NativeArray\<Particle>]\(/engine/6000.5/script-reference/unity/collections/nativearray1)): The input particle buffer, which represents the particle state to apply to particles in this Particle System.**** (\[Trails]\(/engine/6000.5/script-reference/unityengine/particlesystem/trails)): The Trails to apply to the Particle System.

### Remarks

Similar to [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), if you set the lifetime of a particle to a negative value, Unity removes that particle from the particle system. To keep the particle alive until other trails finish, disable Die With Particles in the Trails module Inspector window. Additional Resources: [ParticleSystem.GetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/getparticles.md), [ParticleSystem.SetParticles](/engine/6000.5/script-reference/unityengine/particlesystem/setparticles.md), [ParticleSystem.SetTrails](/engine/6000.5/script-reference/unityengine/particlesystem/settrails.md).
