raycasting from A to B and B to A return diferent value?

i used physic2D.raycast and raycasthit2D to shoot a laser. They have similar script but my Player run well only, my Enemy return wrong value.
I need somebody to help me, please. (T_T)

This video show exactly my problem.


My project: https://www.mediafire.com/?tugys82w2g3ba2b

My Enemy’s Script

IEnumerator EnemyFireLaser()
	{
		line.enabled = true;

		if(!ondelaylayser){
			timelaysershoot-=Time.deltaTime;
			if(timelaysershoot<0)
				ondelaylayser=!ondelaylayser;

			RaycastHit2D hit=Physics2D.Raycast(transform.position,transform.up,100,layermask);
			if(hit)
			{		
				Vector2 pos = transform.position;
				float distance = Vector2.Distance(pos, hit.point);
				line.SetPosition(1,new Vector3(0,distance,0));
			}
			else{
				line.SetPosition(1, new Vector3(0,100,0));
			}
			yield return null;
			}
			else{
				line.SetPosition(1, new Vector3(0,0,0));
				yield return null; 
			}
		line.enabled = false;
	}

My Player 's Script

IEnumerator FireLaser()
	{
		line.enabled = true;

		while(Input.GetButton("Fire1")) {
			if(!ondelaylayser){
				timelaysershoot-=Time.deltaTime;
				if(timelaysershoot<0)
					ondelaylayser=!ondelaylayser;

			RaycastHit2D hit=Physics2D.Raycast(transform.position,transform.up,100,layermask);
			if(hit)
			{		
				hit.collider.gameObject.SendMessage("HIT");
				Vector2 pos = transform.position;
				float distance = Vector2.Distance(pos, hit.point);
				line.SetPosition(1,new Vector3(0,distance,0));
			}
			else{
				line.SetPosition(1, new Vector3(0,100,0));
			}
			yield return null;
			}
			else{
				line.SetPosition(1, new Vector3(0,0,0));
				yield return null; 
			}
		}
		line.enabled = false;
	}

ok i fixed it. prolem cause by the scale