Please help me with Raycast

I want make pong tennis game and thi is supposed to be control of one platforms and 2p01 is name of colider i have this code connect with the platform. Can you help me?
Please help me with this code I have connect it to

private var ray : Ray;
private var hit : RaycastHit;

function Update () {
	if(Input.GetMouseButton(0))
	{
	ray = Camera.main.ScreenPointToRay(Input.mousePosition);
	if(Physics.Raycast(ray, hit))
	{
		if (hit.collider != "2p01")
		{
			Move ();
		}
	  }
      }
}

function Move()
{
	transform.position.x = ray.point.x;
}


}

make it more obvious it has to be

if(hit.collider.gameObject.tag==“your objects tag name”)

also hit.point.x

change this if(Physics.Raycast(ray, hit)) to
if(Physics.Raycast(ray,out hit))