using UnityEngine;
using System.Collections;

public class Destroy : MonoBehaviour {

	private GameObject player;
	public GameObject spawnPoint;

	// Use this for initialization
	void Start () {
		player = GameObject.FindWithTag("Player");
		spawnPoint = GameObject.FindWithTag("Respawn");
	}
	
	// Update is called once per frame
	void Update () {

	}

	void OnCollisionEnter2D(Collision2D collision){
		if(collision.collider.tag == "Player")
			player.transform.position = spawnPoint.transform.position;
	}
}
