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. 

Problem with spawning AI


When I spawn an AI via bueprint (class is AICharacter) it changes the AI's name and the problem is that my level blueprint makes AI_1 follow me, but since I have spawned another AI, it has another name (AI_2) and thus doesnt follow me. Does anyone know how I can make all of the AIs follow me (event tick , simple move to actor) ?

Product Version: UE 4.9
more ▼

asked Nov 18 '15 at 08:49 PM in Blueprint Scripting

avatar image

11 4 8 8

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

1 answer: sort voted first

If you're doing what I think you're doing, you do NOT want to be using the instanced name for any sort of level logic. As you can see, the instanced name changes for each instance of that object (this is done by design, every name must be unique).

What you should probably try to do instead is create a section within your behavior tree code (as either a service or a task) which grabs the nearest character of class type X and sets that as its 'follow' target. You should be able to spawn 100 AI controllers which all have the same behavior.

Also, you don't need to activate the "simple move to" every single tick. Just call it once. It's run on a separate thread of execution, similar to the "delay" node. It will complete once the character arrives at their destination or their path is blocked. If you call it every single tick, you're telling the navigation system to solve the pathing solution every frame, which is a waste of CPU.

more ▼

answered Nov 18 '15 at 09:07 PM

avatar image

819 49 29 73

avatar image SiraX Nov 19 '15 at 03:20 PM

I'm very unexperienced with the behavior tree, could you illustrate what you mean with "which grabs the nearest character of class type X and sets that as its 'follow' target." ?

Also, the blueprint is the AI blueprint, not the level blueprint if that wasn't clear.

(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