# Clear()

> Removes all points from the TrailRenderer. Useful for restarting a trail from a new position.

## Definition

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

```csharp
public void Clear()
```

### Examples

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

[RequireComponent(typeof(TrailRenderer))]
public class ExampleClass : MonoBehaviour
{
    private TrailRenderer tr;

    void Start()
    {
        tr = GetComponent<TrailRenderer>();
        tr.material = new Material(Shader.Find("Sprites/Default"));
    }

    void Update()
    {
        tr.transform.position = new Vector3(Mathf.Sin(Time.time * 1.51f) * 7.0f, Mathf.Cos(Time.time * 1.27f) * 4.0f, 0.0f);
    }

    void OnGUI()
    {
        if (GUI.Button(new Rect(25, 25, 200, 30), "Clear"))
            tr.Clear();
    }
}
```
