TheMuseumProject/Assets/Scripts/Level/TriggerLevelChange.cs

12 lines
270 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
public class TriggerLevelChange : MonoBehaviour
{
public string levelToLoad;
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player") SceneManager.LoadScene(levelToLoad);
}
}