Inventory problem Error (Accessed None 'InventoryWidget'...)
Hello, basically I'm trying to add a inventory system to my game, but I'm not very good at scripting so I am trying to replicate this inventory system from this video;
Everything seemed to work, until I got to epizode 6, Errors are coming up when I try to open my Inventory. From what it says in the error, something is wrong with this blueprint (at least I'm guessing) I really need a fix for this, I would really appreciate someone's help. thanks.
asked Jan 17 '16 at 01:28 AM in Blueprint Scripting
If your boolean variable CanMove is already false before your InventoryWidget is created and applied to InventoryWidget variable then your will get a null reference exception when attempting to access it as is described by the error.
I recommend you shift your CreateWidget logic to BeginPlay and then just AddToViewport when the inventory is accessed.
This way your not always creating a new Widget Object when opening the inventory and you avoid the case whereby your boolean variable is false and the Widget Object is never created.
answered Jan 17 '16 at 08:05 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here