Gizmos.DrawRay has different ray length for similar code

private void OnDrawGizmos()
    {
        Gizmos.color = Color.blue;
        
        Gizmos.DrawRay(transform.position, Vector3.forward * 100f);
    }

The above code work as intended; the blue line projected 100 units from the gameobject.

The code below does not work as intended as the blue line is projecting only 1 unit. The two sets of code looks similar.

private void OnDrawGizmos()
    {
        Gizmos.color = Color.blue;
        Ray ray = new Ray(transform.position, Vector3.forward * 100f);

        Gizmos.DrawRay(ray);
      
    }

Please help… thanks!

From the ray docs:

Ray.direction
The direction of the ray.

Direction is always a normalized vector. If you assign a vector of non unit length, it will be normalized.

Thank you hpjohn!