#Script Errors
1 messages · Page 1 of 1 (latest)
Inventory - https://hastepaste.com/view/DcgB
InventorySlots - https://hastepaste.com/view/hnOZQS
PickupScript - https://hastepaste.com/view/ZYtDI9h
yeah
sec, it got crowded
hmm
This is a bit intricate for this early in the morning.
But if you are absolutely certain that the Object should exist, then I believe it is a problem caused by Script Execution Order
make a new script, and make it a merger of all 3 scripts - just to check -
and if it works, then you can test while moving things out of the main script.
It is possible to control Script Execution Order, but it is rather recommended to rewrite the functionality to be handled in a top-down execution approach, or with an OOP approach (Object Oriented Programming)
it goes into different objects
Why does it have to be different objects?
pickupscript has to be in the object that the player can pick up, inventoryslots goes into the inventory slots, and the inventory can go anywhere
I can merge 2
alright, do that then
hm but
remember: I only suspect this is the issue. I need to wake up a bit more if I am to truly debug that code as it is. One script is more simple to work around.
Hm. Perhaps you should explain why you've structured it as you have.
Another tip - is to add Debug.Logs everywhere
so you see which code is executing before/after one another
ok i will try
ooh
I realized this containedItem = tempitems[slotcode];
i didn't have to instantiate it
Nice ^^