using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Fall : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.tag == “Player”)
{
SceneManager.LoadScene(“GameOver”);
StartCoroutine(Wait());
}
}
public IEnumerator Wait()
{
yield return new WaitForSeconds(2);
SceneManager.LoadScene(“Start”);
}
}
It was supossed to load the GameOver then go back to the Start but it only loads the GameOver.
If i try with the GameOver as a comment its works fine but without it the Start doesnt appear.