using UnityEngine;
using System.Collections;

public class HazardScript : MonoBehaviour {

    private GameObject gameWorld;
	// Use this for initialization
	void Start () {
        gameWorld = GameObject.Find("GameWorld");
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            gameWorld.SendMessage("ReturnToHighestCheckpoint");
        }
    }
}
