How do I access an individual actor with multiple of the same actors on the same level?

I have one AI Actor that I want to spawn several of in a level and then access them individually to give them specific gear or even a name. I’ve duplicated them in my test level and have had success telling them all to follow me using ‘get all actors of class’ and then a ‘for each loop’ function with an array but now how do I just reference one? End goal I would like to open a menu and have a list of all my NPC team mates and access their inventories and loadout from there. The image I’ve attached is how my character gets them all to follow me and is the only reference I have to accessing them in game.

since you mentioned your end goal is to have a list i would simply add them all to an array. to do this i would use on begin play get all actors of class then right click the array return pin and promote it to a variable. this way you will have a list of all the npc characters and you can add and remove from the list as needed. this is also a better method than using a get all of class everytime you want to do something, instead you just use the list thats already mode so its more performant.

i should also mention that to get just one from the array you would use a get node. theres also nodes such as find which could be of help. once you setup your widgets for your inventory and all that though it will be even easier since im sure you will have something like a scrollbox with a button for each npc.

You could simply create a function in yor AI_BP called setName and have a variable there that you define. This way when you use for example your for each loop you could access their name either directly or through a get function. For this to be of any use you would need a way to generate random names though. In my own project i have a enum with names and then i generate a random number to give my AI’s different names. I am not able to access my computer with the project at the moment but if you need further explination I could show you a printscreen later.

edit: Accidentially added this as an answer to your qustion but i realize it’s more of a comment

a get node is to access one object from the array. for example if you wanted the third item in the array then you would take the array and connect the get node and set the index to 2, the get node would then output a reference to the third item in the array.

the find node is just a way to search through an array to find the index where an item is. so lets say you had an array of characters and wanted to find where mario was in the list, then you would have a reference to mario and connect it to the find node and it would output the index that mario is in.

its one of those simple things thats hard to explain.

the get node is the one you need to be worrying about in this case since it allows you to get a specific item from the array.

Thanks for the answers, I’ve added a setName text variable(just a guess at which type) that FittFrasen suggested and I’ve changed the other blueprint on my third person character to where the ‘get all actors of class’ is on begin play but I am not quite sure where to hook up the ‘get’ and ‘find’ nodes.

Thanks for the answers, I’ve added a setName text variable(just a guess at which type) that FittFrasen suggested and I’ve changed the other blueprint on my third person character to where the ‘get all actors of class’ is on begin play but I am not quite sure where to hook up the ‘get’ and ‘find’ nodes.

Works great! thank you for clearing that up for me! I still haven’t tried the find node yet but I’m sure that won’t be too difficult