I am very new to Unity so please excuse my amateur understanding of things. I am currently trying to implement an interface in unity 3d with an inventory including 2D icons which I want to drag and drop from the inventory which should then let the gameObejct spawn. I have tried to implement the exact codes from Jayanam on YouTube, adding you the links here: Create inventory UI: https://www.youtube.com/watch?v=-xB4xEmGtCY&list=PLg7sMWZoap4B8N1pR8nl2-eG_D5k9MfWY Inventory Script: https://www.youtube.com/watch?v=Hj7AZkyojdo&list=PLg7sMWZoap4B8N1pR8nl2-eG_D5k9MfWY&index=2 Inventory UI Drag and Drop: https://www.youtube.com/watch?v=Pc8K_DVPgVM&list=PLg7sMWZoap4B8N1pR8nl2-eG_D5k9MfWY&index=3 Drop Item: https://www.youtube.com/watch?v=db6ofSbAXnE&list=PLg7sMWZoap4B8N1pR8nl2-eG_D5k9MfWY&index=4 Everything works fine, until I reach the point where I want to drop the Item. I can see that it calls the drop-function, but my gameObject doesn't spawn. I am adding you my codes here and I hope that someone might have the answer. GameObject:
HUD Script to handle the Inventory:
Item Drag Handler to pull the Item Image out of the Inventory:
Item Drop Handler:
Inventory Script:
Inventory Item Class
I would be really grateful if someone could help me out. I have been trying forever and I'm going crazy. |