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