Hi I did the same as the tutorial did (please see the code on the bottom part) but when I hit play it will automatically go to the next level
using UnityEngine;
using UnityEngine.SceneManagement;
public class CollisionHandler : MonoBehaviour
{
void OnCollisionEnter(Collision other)
{
switch(other.gameObject.tag)
{
case "Friendly":
Debug.Log("Friendly");
break;
case "Finish":
LandingPad();
break;
case "Fuel":
Debug.Log("Fuel Hit");
break;
default:
ReloadLevel();
break;
}
void ReloadLevel()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex);
}
void LandingPad()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex+1);
}
}
}