Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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. alt text Thank you

Product Version: UE 4.14
ue4 pic.png (152.4 kB)
more ▼

asked Dec 19 '16 at 11:36 PM in Blueprint Scripting

avatar image

13 5 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Dec 20 '16 at 02:03 AM

avatar image

2.6k 62 27 281

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question