Unity Scene Crash After Scene Load
Hi! I am experiencing an issue where my scene crashes the instant it loads. I have a loading scene and a script in there that loads the main scene after 15 seconds. Here is the loading script in case it is causing any problems:
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoadingScreen : MonoBehaviour
{
[SerializeField]
private float delayBeforeLoading = 30f;
[SerializeField]
private string sceneNameToLoad;
private float timeElapsed;
private void Update()
{
timeElapsed += Time.deltaTime;
if (timeElapsed > delayBeforeLoading)
{
SceneManager.LoadScene(sceneNameToLoad);
}
}
}
This script has worked before, and I am unsure why it now crashes the main scene.
Thanks!
This script has worked before, and I am unsure why it now crashes the main scene.
Thanks!
