Selecting scene for your main menu

Hey, al my scripts function except I’ve added a restriction to mouse orbit when the player is in the main menu. My main menu if scene 0. My first level is placed in scene 1. I believe I’ve made a mistake in the coding and it would be nice to have a simple line of coding that lets me define what scenes I wish to allow mouse orbit.
Thanks for your time -DudeSayDude

This is a bit of an unusual way of doing things (I would just put the mouseOrbit in one scene, and not in the other, and then when you load the scene the camera control loads with it), but here’s how you’d do it-

void OnLevelWasLoaded(int curLevel)
    if(curLevel == 0)
        enabled = false;
    } else {
        enabled = true;

Then, have something in ‘Start’ or ‘Awake’ which checks ‘Application.loadedLevel’ in the same way, for when an object is instantiated outside of level loading.