HOWTOGAMEDEV ALPHA

Debugging Vectors - how to draw a line on the screen in Unity3D

Use the debug.drawline command in Unity3d to draw lines on the screen during play and visualize your vectors
You can draw lines using the Debug class. These lines will show up in the Unity's game view if you have the gizmos toggled on. The gizmos can be toggled on the top right bar of the game window, next to the lights and the switch between 2D / 3D button.

In code you would write a simple command to define where the line will be drawn.

Debug.DrawLine(Vector3 Start, Vector3 End, Color);

//for example this will draw a line from the origin
//along the x axis. The line will end once it reaches 1 on the x axis.
Debug.DrawLine(Vector3.zero, new Vector3(1,0,0), Color.red);