Inventory 'Accessed None' Error

I’ve been working on an Inventory system using uObjects and have a bug in a function I made called ‘Get Inventory Items’. When an item is added to an array index I can equip and unequip the item no problem but when I select a slot with no item assigned, these ‘Accessed None’ errors pop up.



Any ideas on how I can resolve this issue?

Can you just put an ‘is valid index’ here?

2 Likes

Hey Clockwork, I tried that with every ‘is valid’ type available but had no luck getting rid of the error.

Thankfully I got it to work with an interface!

The issue seemed to have been the references I made from the ‘for each loop’. My previous inventory system was similar and used a struct with a ‘break’ node coming from the array element pin and the engine had no problem setting everything to ‘null’ values that way, but I guess uObjects require a bit more finesse. I appreciate your input as always.

EDIT:
I also tried it again with the ‘is valid’ node and got it to work. Originally when I tried using the ‘is valid’ node, I plugged the ‘is no valid’ pin directly into the return node. I see now when I set the mesh to be empty, without needing the array to tell it to be empty, it all works just like you say. :sweat_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.