using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class LoadScene : MonoBehaviour { public int playerGoToScene; void OnTriggerEnter(Collider other) { if (other.tag == "Player") { UnityEngine.SceneManagement.SceneManager.LoadScene(playerGoToScene); } } }