How do you change the distance of a Raycasthit2D?

I added a Raycasthit2D for hit detection in my game but the line that comes from the player is way too long and when I hit an enemy it looks like my player is some sort of Jedi which is not what I want. 3067551--230598--Screenshot_1.pngThis is a picture of the distance of the Raycast. (Hotline Miami sprite is a place holder). Is there any way to change the Raycast distance?
This is the code:

//melee attack
            int layerMask = 1<<9;
            layerMask = ~layerMask;
            pa.attack ();
            RaycastHit2D ray = Physics2D.Raycast (new Vector2 (this.transform.position.x, this.transform.position.y), new Vector2 (transform.right.x, transform.right.y),1.5f, layerMask);
            Debug.DrawRay (new Vector2 (this.transform.position.x, this.transform.position.y), new Vector2 (transform.right.x, transform.right.y), Color.green);

            if (curWeapon == null && ray.collider.gameObject.tag == "Enemy") {
                EnemyAttacked ea = ray.collider.gameObject.GetComponent<EnemyAttacked> ();
                ea.knockDownEnemy ();
            } else if (ray.collider != null) {
                if (ray.collider.gameObject.tag == "Enemy") {
                    EnemyAttacked ea = ray.collider.gameObject.GetComponent<EnemyAttacked> ();
                    ea.killMelee ();
                }
            }
        }

If you check the documentation for Physics2D.Raycast, you can see that there are optional parameters, one of which is “distance”.

From your code posted:

RaycastHit2D ray = Physics2D.Raycast (new Vector2 (this.transform.position.x, this.transform.position.y), new Vector2 (transform.right.x, transform.right.y),DISTANCE_IS_HERE, layerMask);