RayCast not working when i add a 2D collider

Hi, I’m Learning to Program with Unity, but i’m having problems with RayCast.
This is what i’m trying to do: I have 2 Objects, one of them contains a Script to RayCast to detect if anything is close to it (Y Coords Only its a 2D game). It works if the object that casts the Ray doesnt contain a 2D Collider, but if i add a 2D collider it stops casting.

What do you guys think, i’m doing wrong, how can i fix this?

#pragma strict
var count=0;
var vel=10;
var raydistance=1;
function Start () {
	transform.position = Vector3(0, 7, 0);

}

function Update () {
	
	transform.Translate(0,-vel*Time.deltaTime,0);
	
		if (transform.position.y < -7){
			transform.position = Vector3(0, 7, 0);}
			
	var hit: RaycastHit2D = Physics2D.Raycast(transform.position, -Vector2.up, raydistance );
	if (hit.collider != null && hit.collider.gameObject.tag == "OB2"){
 			Debug.DrawRay (transform.position, -Vector2.up, Color.green);
 			count = count +1 ; <--- Just for Debugging
 		}
 
	
	

}

function OnGUI () {
	GUI.Label (Rect (10, 60, 100, 20), "" +count);
}

Problem Solved!
I added a OffSet to the RayCast Starting Position

var hit: RaycastHit2D = Physics2D.Raycast(Vector2(transform.position.x,transform.position.y-2), -Vector2.up, raydistance );