Ray Cast Not Shown SceneView??

Ray not visible in scene view??

   private void Update()
        {
            Debug.DrawRay(transform.position, transform.TransformDirection(Vector3.forward) *   maxdistance , Color.yellow);
           
           if (Physics.Raycast(transform.position,transform.TransformDirection(Vector3.forward), out hit, maxdistance,layerMask))
            {
       
                 if (hit.collider.gameObject.tag == "obstacle")
                  {
                       move = false;                                                         
                    }
                }
         }

the code is fine so if its not showing anything is because it is not being called, are you sure is attached to a object? also why not just use transform.forward rather than transform.TransformDirection(Vector3.forward)