So I understand coroutines and I’ve used them before, but I’m not sure what we gained by using them here. I was curious and I slightly modified the code to not use a coroutine. When I run it, it seems to just just fine, just as I expected. I can’t notice any difference.
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
DontDestroyOnLoad(gameObject);
SceneManager.LoadSceneAsync(sceneBuildIndex);
Debug.Log("Scene Loaded");
Destroy(gameObject);
}
}