TheFrontRoomsGame/Assets/Scripts/LoadNextScene.cs
2023-03-24 10:33:36 +00:00

15 lines
No EOL
367 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadNextScene : MonoBehaviour
{
public string nextSceneName; // the name of the next scene to load
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
SceneManager.LoadScene(nextSceneName); // load the next scene
}
}
}