#pragma strict
var velocity1 : Vector3;

function Start () {

}

function Update () {
	var xpos = Input.mousePosition.x;
	var ypos = Input.mousePosition.y;
	velocity1 = GameObject.FindGameObjectWithTag("Sphere").rigidbody.velocity;
	
	if (velocity1.y > 20)
	{
		velocity1.y = 19;
	}
	if (velocity1.y > -20)
	{
		velocity1.y = -19;
	}
	
	GameObject.FindGameObjectWithTag("Sphere").rigidbody.velocity = velocity1;
	
	transform.position = Camera.main.ScreenToWorldPoint(Vector3(xpos, ypos, 5));
	
	if (Input.GetKeyDown(KeyCode.Space))
	{
		
	}
}