Debug.DrawLine Manual     Reference     Scripting  
Scripting > Runtime Classes > Debug
Debug.DrawLine

static function DrawLine (start : Vector3, end : Vector3, color : Color = Color.white) : void

Description

Draws a line from the point start to end with color.

The line will be drawn in the scene view of the editor. If gizmo drawing is enabled in the game view, the line will also be drawn there.

JavaScripts
// Draws a red line from the world-space origin to the point (1, 0, 0)

function Update () {
Debug.DrawLine (Vector3.zero, Vector3 (1, 0, 0), Color.red);
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Update() {
Debug.DrawLine(Vector3.zero, new Vector3(1, 0, 0), Color.red);
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Update():
Debug.DrawLine(Vector3.zero, Vector3(1, 0, 0), Color.red)