using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; /// /// This code is for restarting the level, if the player collides with any object tagged objects, /// load scene 1 which is the starting psition and print to the console. /// public class crash : MonoBehaviour { private void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "objects") { SceneManager.LoadScene(1); Debug.Log("Collided with object, Level Restarted"); } } }