how to make it so i can see a raycast

ok heres my raycast script

var damage : float = 1;
function Update(){

function FireOneShot(){
   var direction = transform.TransformDirection(Vector3.forward);
   var hit : RaycastHit;

   if (Physics.Raycast (transform.position, direction, hit, 300)) {
   Debug.DrawLine (transform.position, hit.point, Color.cyan);

   hit.collider.SendMessageUpwards("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver);

how do i make it so i can see the raycast bullet?
i figured that

Debug.DrawLine (transform.position, hit.point, Color.cyan);

would draw a blue line, but it didnt.

Debug.DrawLine works just fine, but you have to give it the proper arguments. If you call it outside of Update, and all you supply is a startpoint, an endpoint and a color, the function draws a line for just 1 frame, like the docs say:

If your game renders more frames/sec than 60, then chances are the frame that contained the ray got overwritten in the framebuffer before your monitor asked for an update, and consequentially, you'll never see it even for a splitsecond.

Add some number of seconds after the color so the ray stays visible for a time to see it, and remember that the lines drawn by Debug.DrawLine are Gizmos! (IMPORTANT, this had me scratching my head for an unreasonably long time before). This means you have to turn on Gizmos (top right corner, next to the Stats button) to see it, or the ray stays invisible.

I don’t understand why they just don’t let us make raycasts appear like gizmos in the scene view, if you make a mistake in your drawray, you’ll think your raycast is not good so you’ll change it, then you’ll think it’s good but it’s not because you changed the value.
One mistake and it’s broken :confused: