once again, here is my code:
using UnityEngine;
using UnityEngine.SceneManagement;
public class CollisionHandler : MonoBehaviour
{
void OnCollisionEnter(Collision other)
{
switch (other.gameObject.tag)
{
case “Friendly”:
Debug.Log(“This thing is friendly”);
break;
case “Finish”:
Debug.Log(“Congrats, yo, you finished!”);
break;
case “Fuel”:
Debug.Log(“You picked up fuel”);
break;
default:
ReloadLevel();
break;
}
}
void ReloadLevel()
{
int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
SceneManager.LoadScene(currentSceneIndex);
}
}
I copied the code exactly, and I’m using version 2020.3f.7 BTW