Having issue where the scene is not loading. I am on VS studio. Also, I couldn’t get the strings to show up on console with previous switch statement lecture. The following is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class CollisionHandler : MonoBehaviour
{
void OnCollisionEnter(Collision other)
{
switch (other.gameObject.tag)
{
case “Friendly”:
Debug.Log(“All good. No problemo.”);
break;
case “Finish”:
Debug.Log(“You didn’t suck!”);
break;
case “Fuel”:
Debug.Log(“You’ll probably need this.”);
break;
default:
ReloadLevel();
break;
}
}
void ReloadLevel()
{
SceneManager.LoadScene(0);
}
}