#Item does not get collected, but it disappears as if it did

4 messages · Page 1 of 1 (latest)

coral cove
#

What is currently happening: I have 2 items in my game, seaweed and gold_shell. I coded the seaweed in first, but used the same process and quite literally the same code for the gold_shell, but changing what resource it was attached to. (code in first screenshot)

The seaweed is perfect. It gets collected and works perfectly, even if it's picked up after the gold shell.
However, the same can't be said for the gold shell. If the player picks up the gold shell first, then its all fine, it works normally. But if the 1st inventory slot is full with seaweed, it does not get collected. It disappears as it should, but does not appear in the inventory.

If I move whatever is in the 1st inventory slot out of it, and then pick up a shell, it appears properly.

Included are also other screenshots of my code in other relevant scripts. Any idea what I could be causing this to happen?

let me know if more screenshots are needed and of what

inner crow
#

In inventory.gd you are returning out of the second for loop no matter what.
You only want to return if you have just set an empty slot to have a new item.
Just tab the last two lines in so they are part of the if statement.

coral cove
#

the very last two of the script? Alrighty, ill try

#

oh no wait nvm i misread what you said