using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class MenuButton : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
    }

    public void LoadScene(string sceneName)
    {
        // this line below isn't recognized even if scene management is mentioned above
        SceneManager.LoadScene(sceneName)
    }
}

I saw a few Youtube videos and nothing works, also when I write using, it doesn't show unity suggestion nor scene management suggestions.

2

There are 2 best solutions below

0
lulasz On

I have seen some people creating a script called "SceneManager.cs", and this is mostly causing this issue, since it has the same name, but different namespace.

0
Jiale Xue - MSFT On

This should be a syntax error.

As Bart said, you are missing the statement closing symbol ;.

Try the code below:

public void LoadScene(string sceneName)
    {    
        SceneManager.LoadScene(sceneName);
    }

If programming in VS, you should be able to use ALT+ENTER to take quick suggestions to fix some errors.