After Attaching the script to the loose collider and hitting the play, the ball keeps falling without loading to the ‘game over scene’
Here is my Loose Collider Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class LoseCollider : MonoBehaviour
{
private void OntriggerEnter2D(Collider2D collision)
{
SceneManager.LoadScene("Game Over");
}
}
And this the Scene Loader
codeusing System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneLoader : MonoBehaviour
{
public void LoadNextScene ()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex + 1);
}
public void LoadStartScene()
{
SceneManager.LoadScene(0);
}
public void QuitGame()
{
Application.Quit();
}
}