#pragma strict
var pushstrenght : float;
function Start () {

}

function Update () {

}

function OnTriggerStay2D (other : Collider2D){
	if(other!=null && transform.parent.GetComponent(Movement).isPushing){
		var distance : float;
		distance = Vector2.Distance(other.transform.position, transform.position);	
		other.attachedRigidbody.AddForce( (pushstrenght/Mathf.Sqrt(distance)) * Vector2((other.transform.position.x- gameObject.transform.parent.transform.position.x),(other.transform.position.y- gameObject.transform.parent.transform.position.y)).normalized);
	}
}