Can't add GameObjects to the inspector

Now, I don’t really think this makes any sense… I am making a script to change between cameras as asked in my assignment. For my project I’m using the cameras as ‘floors’ to a dungeon, I did some tests earlier and I do know how to control them, I was making the scripts needed and, this is what my “warp” script looks like.

#pragma strict
var Lv1Camera : Camera;
var Lv2Camera : Camera;
var warpMessage : boolean; 
var warpStyle : GUIStyle;
     
function Start () {
   	warpMessage = false; 
   	Lv1Camera.enabled = true;
   	Lv2Camera.enabled = false;
 
 }
 
function Update () {
 
}

function OnTriggerStay(other : Collider)
{
	if(other.tag == "Player")
	{
		warpMessage = true;
		if (Input.GetMouseButtonDown(1))
    	{
    		if (Lv1Camera.enabled == true)
    		{
    			Lv2Camera.enabled = true;
    			Lv1Camera.enabled = false;
  			}
  		}
    	else if (Lv2Camera.enabled == true)
    	{
   		 	Lv1Camera.enabled = true;
   			Lv2Camera.enabled = false;
   		}
 	}
}



function OnGUI()
{
	if(warpMessage)
		GUI.Label(Rect(0,Screen.height/2,512,512), "Use the Right-Click in your mouse if you are ready for the next level", warpStyle);
}

I placed the script on my prefab as normal, but, when I try to add the cameras I want to use as variables to the script in the inspector, Unity is just not letting me drag them there. I even tried making a third variable for a GameObject of any kind, and still, unity is not letting me drag objects into this particular script, can anyone tell me the reason why?

Are you trying to add them to the prefab in the project window? That is not possible because the cameras are (and need to be) scene items and you can’t add scene items to scripts in the project window because the project window is for things that could be used in any scene.

If that’s the case put an object of the prefab type in the scene and add them there.

Thats all well and good but it does not change the prefab in the project window. is there no way to change my prefab to having the game object added?

I am having EXACTLY the same problem, 8 years and still no answer :frowning: