draw debug line unity code example
Example 1: debug.drawline unity
Debug.DrawLine(Vector3 a,Vector3 b);
Debug.DrawLine(Vector3 a,Vector3 b, Color color);
Debug.DrawLine(Vector3 a,Vector3 b, Color color, float duration);
Debug.DrawLine(Vector3 a,Vector3 b, Color color, float duration, bool depthTest);
Example 2: unity drawline
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);
}
}