Cursor stays forced locked when moving into a mostly empty scene

The script that is the only thing controlling the cursor lockstate is in this, even outside of it it changes nothing.

public void Update()
{

    if (OnMainMenu == true)
    {
        mainmenuinspect = true;
    } else
    {
        mainmenuinspect = false;
    }

    if (!IsPaused && !OnMainMenu)
    {
        Cursor.lockState = CursorLockMode.Locked;
    } else
    {
        Cursor.lockState = CursorLockMode.None;
    }

    if (Input.GetKeyDown(KeyCode.Escape) && !OptionsOpened && !OnMainMenu)
    {
        if (!IsPaused)
        {
            Pause();
        } else
        {
            Resume();
        }

        if (!IsPaused && !OnMainMenu)
        {
            Cursor.lockState = CursorLockMode.Locked;
        } else
        {
            Cursor.lockState = CursorLockMode.None;
        }

    }
    if (Input.GetKeyDown(KeyCode.Escape) && OptionsOpened)
    {
            CloseOptions();
    }
}

When I load into the next scene the cursor stays locked and won’t unlock no matter what, it works going to the main menu and back, and the trigger taking me to the next scene isn’t affecting it. There’s only a single ultra basic script in the next scene other than planes.

public class SpawnHere : MonoBehaviour
{
    public GameObject Player;
    void Start()
    {
        Player = GameObject.Find("Player");
        Player.transform.position = transform.position;
    }

}

None of the variables that could affect it unlocking are doing it, they’re all working right, and I’ve even tried to change the lockstate in that spawn script but it does nothing. Even just tried loading into a completely blank scene and it still stays forced locked, it makes no sense. Everything the script interacts with outside of the main menu bool is attached to it, and nothing related to the main menu that’s not even active or in the scene normally could be affecting it, it should work.

Edit: Just realized I had the lockstate stuff doubled up in there, it’s not usually like that when I’m trying, I’ve switched it around a ton of times.

Got it :slight_smile:

Didn’t know that needed an event system, I’d never added one to a scene before and somehow both the main menu and testing area both had one. Just dragging the main menu one around now.