Search Unity

Menu Doesn't Work

Discussion in 'Editor & General Support' started by SoapySniper, Mar 23, 2020.

  1. SoapySniper

    SoapySniper

    Joined:
    Jul 24, 2018
    Posts:
    2
    Hey! I've been playing with Unity for a while now but only started getting into building my own game about 3 days ago. I've made a tutorial level and have a trigger at the end of the level set up to take me back to the menu scene (Code attached)
    but, this happens:
    https://screenrec.com/share/LzlM4stdZH

    If anyone could help me that would be great :)

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.SceneManagement;
    5.  
    6. public class MainMenu : MonoBehaviour
    7. {
    8.     private void OnTriggerEnter(Collider other)
    9.     {
    10.         if (other.CompareTag("Player"))
    11.         {
    12.             SceneManager.LoadScene(0);
    13.             Cursor.lockState = CursorLockMode.None;
    14.             Cursor.visible = true;
    15.         }
    16.     }
    17. }
    18.