You are on page 1of 1

using System.

Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class Loadnewarea : MonoBehaviour {

public string levelToLoad;

// Use this for initialization


void Start () {

// Update is called once per frame


void Update () {

void OnTriggerEnter2D (Collider2D other) {

if(other.gameObject.tag == "Player")
{
SceneManager.LoadScene (levelToLoad);
}
}
}

You might also like