I am making a inventory system with three inventory slots. My script does deactivate the UI from the items when i pick them up because I dont want it to show up when I hold them (ik the image of it says E but the keybind is F
). (Please dont mind the way the script is written, I aint the best).
Everything works how it should, but when I change inventory slots and swap back to one I hold an item in, the UI of it shows again(evem tho it shouldnt show when its in my hand) and isnt able to deactivate again. I cant figure out how to solve it.
Under my player Gamobject is a empty Gameobject called Hand.
My cube looks like this:
Cube(InvetoryItemSystem, ItemUIUnHideScript)
Canvas(ItemUIShowScript)
The BoxCollider of the cube is still deactivated when I switch itemslots.
I think the problem is at the part of the Gameobject activating and deactivating again. Some one please help me
. Thanks (I will send the scripts in the chat under this)