inventory system Bug for when I click the item in my inventory it doesn't get brought up anymore after clicking it

Hello, I really need some help with a bug that’s in my inventory system, usually when I have the item in my inventory I can click on it and bring it up, but now I can’t do that again here’s the error:

Blueprint Runtime Error: “Attempted to access BP_BasementKey_C_0 via property Item, but BP_BasementKey_C_0 is not valid (pending kill or garbage)”. Node: Open Item from Inventory Graph: EventGraph Function: Execute Ubergraph WB Inventory Slots Blueprint: WB_InventorySlots

1 Like

I assume this is when you try and inspect the basement key? :smiley:

Somehow, you’re destroying it just before you try and look at it.

Yes i tried to inspect it from my inventory, but i dont see how its being destroyed. I only get the error when i click on the open button from my wb_inventorySlot that is connected to a open from inventory custom event, would you like a screenshot of it?

1 Like

You can try.

It probably won’t help, as these inventory things are usually a spaghetti junction :sweat_smile:, but somehow, that seems to be happening.

Do you have ‘destroy component’ in your code anywhere, or destroy actor?

Actually, I was uncertain at first if anyone could help me on this, but I have hope
Yes, I have a destroy component on the bp_inspector base which is the parent of the key



1 Like

I found out two things, first is that anytime I add the destroy component to one of the children it gives me that error, another thing is that the same component I changed its name a while back but now I’m trying to change it to its previous name its telling me that its already there even though it isn’t so my thought is the reference got messed up, I even tried to fix redirectors but no good any ideas?

1 Like

There are two filters for redirectors, you might try both

image

If you mean component name in the blueprint, then compile, save and restart the editor, and try again.

I can’t see a glaring error is this code, although I would just trace your logic very slowly. Is it doing what you think it is?

(post deleted by author)

yeah, it’s funny I don’t see an error for that, but the place where the error pops up in the first screenshot I sent you I tried using a is valid all it did was stop the error from showing. Question did you see anything in the codes that aren’t supposed to be there?

Nope, its just what happens when you try and access something that is in the middle of being destroyed ( or has been ).

I see I’m not fully a hundred on this, but I think it’s being destroyed while I’m going to inspect it. These are the three places in the event graph where the parent blueprint is being destroyed



1 Like

You can just put a print string in there, then you know what’s calling it :slight_smile:

1 Like

Well, I believe and get what you’re saying, and I’ve been testing somethings, but I see that when remove the destroy actor node in the destroy component everything works fine but the issue with that is the item no longer gets saved when I save and load my game it just comes back into the world so yeah some destroying is going on.

1 Like

Yep, when I click on it in the inventory menu a second time the print string said destroyed it brings me here, I’ve tried is valid no luck even went it into and messed around