# DrawDottedLine(Vector3, Vector3, float)

> Draw a dotted line from p1 to p2.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.3/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void DrawDottedLine(Vector3 p1, Vector3 p2, float screenSpaceSize)
```

### Parameters

**** (\[Vector3]\(/engine/6000.3/script-reference/unityengine/vector3)): The start point.**** (\[Vector3]\(/engine/6000.3/script-reference/unityengine/vector3)): The end point.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The size in pixels for the lengths of the line segments and the gaps between them.

### Remarks

![DrawDottedLine (DrawDottedLine(Vector3, Vector3, float))](/api/media?file=/engine/6000.3/media/images/DrawDottedLine.png)

*Draw Line in the Scene View.*

```csharp
// Draw lines to the connected game objects that a script has.
// If the target object doesn't have any game objects attached
// then it draws a line from the object to (0, 0, 0).

using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(ConnectedObjectsExample))]
class ConnectLineHandleExample : Editor
{
    float dashSize = 4.0f;
    void OnSceneGUI()
    {
        ConnectedObjectsExample connectedObjects = target as ConnectedObjectsExample;
        if (connectedObjects.objs == null)
            return;

        Vector3 center = connectedObjects.transform.position;
        for (int i = 0; i < connectedObjects.objs.Length; i++)
        {
            GameObject connectedObject = connectedObjects.objs[i];
            if (connectedObject)
            {
                Handles.DrawDottedLine(center, connectedObject.transform.position, dashSize);
            }
            else
            {
                Handles.DrawDottedLine(center, Vector3.zero, dashSize);
            }
        }
    }
}
```

And the script attached to this Handle:

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

public class ConnectedObjectsExample : MonoBehaviour
{
    public GameObject[] objs = null;
}
```
