UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"On trigger touch, switch to scene with name"
using UnityEngine; using UnityEngine.SceneManagement; public class SwitchSceneOnTrigger : MonoBehaviour { public string sceneName; private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { SceneManager.LoadScene(sceneName); } } }