using UnityEngine;
using System.Collections;

public class StickToPlatform : MonoBehaviour {

	void OnCollisionStay2D (Collision2D other) {

		if (other.gameObject.tag == "Platform") {

			transform.parent = other.transform;

		}

	}
	void OnCollisionExit2D (Collision2D other) {

		if (other.gameObject.tag == "Platform") {

			transform.parent = null;

		}
	}
}
