How to get which number the actor duplicate is.
The question was a little confusing, so to give a little context I am talking about the name of the character. When there are multiple blueprints in the world, the name of that blueprint will be Blueprintname_0, Blueprintname_1, etc. My question is how do I get that number within the blueprint? As in, what function should I call to get that integer? I am trying to spawn waypoints within the blueprint for each duplicate blueprint to follow, and I need the number to show which waypoint the duplicate should follow. If this is answered somewhere else or there is documentation please direct me to it. Also if there is a better way to do what is described above please let me know. Thank you
Yes, there is a better way. What you want to do is create an array inside your AiCharacter that holds your waypoints in the proper order. In my AiCharacter class I do this with an array of vectors, but in your case it looks like you are using a target point class. Trying to get the number at the end of the blueprint instance names is not a good method and is prone to error. A good pattern to follow is to try have some object holding pointers to objects related to it and not have to rely on Get Actors of Class which can be relatively expensive since it always has to iterate through the whole level instead of just the related actors.
answered Dec 20 '16 at 02:03 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here