how do i get a variable and re use it later in my blueprint

oke so i have this script where everytime it spawns in the world i want it to get a random actor (items) i have in my game (i have now just 1) take those actors out of a list want to save the name of the actor in a string variable to re use it later

after that i do some ai moving stuff (what works)

and then i want to get that name what i connected to that array what i get a random item out of that array and put it on a string variable and re use that name to destroy that actor (item)

my question now is that he will not get that the connection between the name in the beginning of the blueprint and the array item is the same as the set name on the end he does not see that connection and will keep destroying my npc how can i fix this?

thanks for any effort in helping me :slight_smile:

here is the third picture

Hey there @DarkHound2000! Welcome to the forums!

So with what I’m seeing here, let me ask this: is the PrintString saying “has item”? Or is it saying “No Item”? Let’s start there. Because it looks like you’re asking if the Trigger Item has the bool of Has Item.

wel i use hasitem in a other script here is a picture

hasitem has nothing to do with it i just want to have the random actor in the array i have created in the beginning and want to use that actor the script has randomly chosen and destroy it in the end

later i want to use a itemlist instead of using hardcoding the item (axe)