# DrawLine(Vector3, Vector3)

> Draws a line starting at from towards to.

## Definition

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

```csharp
public static void DrawLine(Vector3 from, Vector3 to)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): **** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)):&#x20;

### Remarks

If you need to draw many lines consider the [Gizmos.DrawLineList](/engine/6000.0/script-reference/unityengine/gizmos/drawlinelist.md) or [Gizmos.DrawLineStrip](/engine/6000.0/script-reference/unityengine/gizmos/drawlinestrip.md) functions which are much faster than repeatedly calling this function to draw lines individually.

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

public class ExampleClass : MonoBehaviour
{
    public Transform target;

    void OnDrawGizmosSelected()
    {
        if (target != null)
        {
            // Draws a blue line from this transform to the target
            Gizmos.color = Color.blue;
            Gizmos.DrawLine(transform.position, target.position);
        }
    }
}
```

Additional Resources: [Gizmos.DrawLineList](/engine/6000.0/script-reference/unityengine/gizmos/drawlinelist.md), [Gizmos.DrawLineStrip](/engine/6000.0/script-reference/unityengine/gizmos/drawlinestrip.md).
