to make it simpler, i want users to be able to use one script, and that script loads a mouseOrbit onto the camera when a button is pressed, and unloads it when it’s pressed again.
can i do “if button down, camera.main.AddComponent (“mouseOrbit”);”
You don’t need to do this. Instead, you could goahead and add the script to the camera and uncheck it. Then when your button is pressed, call mouseOrbit.enabled = true;
You’ll need to get a reference to the mouseOrbit script. You can do that by making it public and linking it in the editor, if there is a finite number of buttons. If they are spawned at runtime however, you would do mouseOrbit = Camera.main.GetComponent();