Debug.DrawLine not working in Scene view with Update();

It isn’t working in Scene view

function update   (   ){
   Debug.DrawLine (Vector3(1,2,3),Vector3.zero,  Color.green, 2, false);
  Debug.DrawLine (Vector3.zero, Vector3 (10, 0, 0), Color.red);

}

Debug.DrawLine doesn’t work in Scene view only Game view. ← WRONG! it only draws in Scene view while playing… and not in Game view

if you want to draw something in the Scene view use OnDrawGizmos().

This is an attempt at java, which I translated…

function OnDrawGizmos()
{
  Gizmos.color = Color.red;
  Gizmos.DrawLine(Vector3.zero, Vector3 (10, 0, 0));
}

remember to wrap this in an #if UNITY_EDITOR and also include

using UnityEditor;

(I would wrap that in the unity_editor also assuming that you haven’t put this script in the editor folder)