hi I created a simple code for when you press a button you get taken back to the main menu screen however when I input it into the button the function that I wrote doesn’t appear and I’m unable to make the button work because nothing seems to change idk if there is a better way to make it so that when you press a button it takes you to the menu but I’m still pretty new so I’m still very lost in some aspects of coding and unity in general.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void ReturnMenu ()
{
SceneManager.LoadScene("Menu");
}
}