# rateOverDistance

> The rate at which the emitter spawns new particles over distance.

## Definition

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

```csharp
public ParticleSystem.MinMaxCurve rateOverDistance { get; set; }
```

### Remarks

The emitter only spawns new particles when it moves. If the system's GameObject contains a Rigidbody or Rigidbody2D component, and the system's **Emitter Velocity** property is set to **Rigidbody**, Unity calculates the distance based on the velocity of the Rigidbody. Otherwise, Unity calculates the distance based on how far the GameObject's Transform component has moved since the last update. Additional Resources: [ParticleSystem.MinMaxCurve](/engine/6000.3/script-reference/unityengine/particlesystem/minmaxcurve.md), [ParticleSystem.EmissionModule.rateOverTime](/engine/6000.3/script-reference/unityengine/particlesystem/emissionmodule/rateovertime.md), [ParticleSystem.MainModule.emitterVelocityMode](/engine/6000.3/script-reference/unityengine/particlesystem/mainmodule/emittervelocitymode.md).

### Examples

```csharp
using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    private ParticleSystem ps;
    public float hSliderValue = 5.0f;

    void Start()
    {
        ps = GetComponent<ParticleSystem>();

        var main = ps.main;
        main.simulationSpace = ParticleSystemSimulationSpace.World;

        var shape = ps.shape;
        shape.enabled = false;

        var emission = ps.emission;
        emission.rateOverTime = 0.0f;

        // add a sphere so we can see our transform position as it moves
        var sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        sphere.transform.parent = ps.transform;
    }

    void Update()
    {
        var emission = ps.emission;
        emission.rateOverDistance = hSliderValue;

        ps.transform.position = new Vector3(Mathf.Sin(Time.time) * 2.0f, 0.0f, 0.0f);
    }

    void OnGUI()
    {
        hSliderValue = GUI.HorizontalSlider(new Rect(25, 45, 100, 30), hSliderValue, 1.0f, 20.0f);
    }
}
```
