Script wont let me drag and drop GameObject Of UI Menu into it?

IM following a tutorial where he makes a simple menu. very straight forward, when you hit a certain key, the menu pop up. For him and Usually for me, he makes a serialized field of the UI var, then inside Unity, drags the UI canvas/images/temnplate/menu into this script. Now ive done this time and time again, with no issues, but this time, when trying to drag this particular gameobject That is basically a canvas of images creating this menu. It will not let me drag it in? It simply has a stop sign emblem basically saying it wont accept? I click the browse button next to it, only to see it says “None” From the list? Why the heck wont my script allow me to add this gameobject? Any help is appreciated, thanks.


The structure goes a such: within my hierarchy: gameObject Parrent Called “UI_Inventory”. Within that parent, we have the background which is basically just an image with transparent, the image of a few practice items, the container for the menu itself, etc. Alls is literally hardcoded right now. Meaning… They are just still images and texts that are not being fed any data yet.


Thats it. All im trying to do, is just simply get this menu/inventory canvas, to just pop open when hitting a certain key. But within my Player Script, within the inspector, the Serialized Field is there waiting to be added, but it just simply wont allow it? X’ed out/Grey’ed out…???


Here is my Code incase that matters?:

[SerializeField] private UI_Inventory uiInventory;

Pic UI_Inventory:
166712-forunityanswer1.png

Pic Of Hierarchy:
166713-forunityanswer2.png

Pic Of Inspector: WILL NOT ALLOW ME TO DRAG THE UI_INVENTORY onto the SerializedField.:
Welp apparently can only do 2. But ya, it wont let me drag it into my script??

It may seem silly but you didn’t specify it : does your UI_Inventory gameobject has a UI_Inventory script attached to ? If not, this is the issue, what unity editor expect here from you is to drag and drop the UI_Inventory script not a gameobject called such as the class name.