I’m having a problem getting variable information from an array of actors. I want to add items into an array and pull up information from those items later. The problem is that when I try to get any of the actor’s variables it says the variable is not in scope. I thought maybe because I needed to cast the item in the array, but it just keeps failing the cast.
The strange thing is that if I look at the line coming off the first GET node it shows what actor is being referenced, but the item info is not in scope. Also, at the second GET node it will only print the item name if it’s the first item I pick up. Even though I’m referencing the same item in the array, I can’t get it to print the name on successive item pickups.
I’m not sure what you wish ti print in the first
PrintText but if you wish the print the name of the item you just added to your inventory, you’ll need to get the item from the inventory using the index returned by the
Add method. Here’s an example:
I might have misunderstood your question. If so, please let me know, but I do hope this helps
Agreed, right now your current set up will only ever return the “0” index of the array which will always be the very first item you pick up…ALWAYS.
I know that I can get the name of whatever I just put into the array, but if I want to get any information about the item after that, the variables are not in scope anymore. Say I pick up my first item. I can look at any information about that item right there. When I pick up my second item I want to see if the two items have the same name. The problem is I can no longer access the information of the first item. Even though when debugging I can see that the correct item shows up off the GET node, when I ‘getItemInfo’ it’s no longer in scope.
Ah, I did misunderstand your question then. I just tried replicating your issue, but it works fine for me? Could you show us the details of the actors from the world outliner? The one that’s already in the inventory, and the new one your adding?
I’m not sure I understand what it is your asking for. Here’s a pic of my potions within the level and their info from the world outliner. I’ve also attached a pic of the overlap event with my character. I should note that it’s the blueprint of a masteritem and that I have child classes for the health/mana potions. Maybe it has something to do with the way I set up the class structure?