Getting Array gives me an accessed none error

Trying to have text change on the ui based on an array. When getting an array from another blueprint it causes an accessed none error. Why does the original array give me an error it give me an error?

As an “experiment” I used an array from the ui (using the same structure) and it worked.

That’s because in the last image you are using an “array” that is local to the blueprint so “On Construct” the widget has all the info it needs to utilize that array since it resides within itself. The first image, the one that creates an error, you are asking the widget “On Construct” so…the very first thing it does, to use an array that is located in the variable “Silvia” which is a “reference” to the actual object “Silvia”. The problem with this is, the engine has no idea when it creates this widget who or what “Silvia” is. You have not created the cast or direct reference to this object before using the variable that “points” to it. So the engine is confused because it doesn’t know what “Silvia” is and you’re asking it to get an array out of that object. Create the cast node or however you got that reference variable…create that FIRST then use the variable and you will be fine.

Something like this? It still gives me an error

I’m confused now. These are all in 1 widget? I looked at your first set of screen shots you have “UI Inventory 2” in 2 screen shots, both with an “event construct” connected to separate things which isn’t possible unless these are 2 separate widgets named the same thing which you can’t do. Did you have 2 different versions of the same widget and you screen shot different attempts? Then the second set of shots I am not seeing what you did differently, looks the same as one of the original shots. What I am saying is “Silvia” is clearly NOT part of whatever BP you are using the array in (ie UI Inventory 2) because you are getting an “array” out of it which means it isn’t part of the UI Inventory 2 BP. “Array Test” IS part of that BP which is why you can use it without a reference. So what you need to do is cast to “Silvia” and make that the reference. “Self” is going to return a reference to the UI Inventory BP which is clearly NOT “Silvia” and does NOT have the “Inventory” array.

You can’t create a reference to Silvia from Silvia…you need to cast to it from the widget BP where you want to use it. You also need to get a direct reference to feed into the cast node to create the reference pointer in the widget. I made a tutorial on casting that may help you understand what I’m trying to explain in words. Depending on what Silvia is…will determine how you create the reference.

The event begin play (the one where set silvia ref to self) is from the silvia blueprint. Sorry im new to blueprints

When i do use a cast to silvia it gives me a “cast failed”