var target : Transform;
var targetLocked : boolean = false;
var targetPos : Vector3;
var climbSpeed : float;

collider.isTrigger = true;
gameObject.tag = "Rope";

function Update () {
	if(!target){
		playerLocked = false;
		target = GameObject.FindWithTag("Player").transform;
	}
	if(targetLocked == true){
		targetPos.y += climbSpeed * Input.GetAxis("Vertical");
		target.position = targetPos;
	}
	
	if(Input.GetButtonDown("Jump")){
		targetLocked = false;
	}
}

function OnTriggerEnter(col : Collider){
	if(col.transform == target){
		targetLocked = true;
		targetPos = target.position;
	}
}