x

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"

how to put multiple target with the fonction get controller?

I want to know if i can put multiple target instead of copy past my graph. my problem: i create a blueprint for the npc t be able to move to a random point but i can only add one npc (civil 1) but i want to add civil 2 to this function.. :( and i don't want to copy paste.. here a picture:

alt text

Thanks and sorry for my bad english.. :(

Product Version: UE 4.10
Tags:
problem!!!.jpg (79.1 kB)
more ▼

asked Apr 11 '16 at 12:49 AM in Blueprint Scripting

avatar image

badcat231944
1 2 1

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

1 answer: sort voted first

Yes you need to use a for loop for this.

You would first make array with all the player controllers stored in a variable. Then you would you access them one by one in a for loop.

Here is a comprehensive article

Arrays: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/BP_HowTo/WorkingWithArrays/index.html

For loops: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/FlowControl/index.html#forloop

If you think this is too hard and only have a few controllers, you coud duplicate the blueprint and put into a function.

And call your function multiple time with each controller:

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Functions/index.html

Hope this helps.

more ▼

answered Apr 11 '16 at 07:10 AM

avatar image

keyle
1.8k 65 27 89

avatar image dsmith Apr 11 '16 at 07:16 AM

Keyle correctly answered the question.

I would recommend however a different approach to this particular problem. Put "Simple Move To Location" IN the npc blueprint. This way you don't have to iterate through an array of them.

Think of things your NPC can do on their own as things that should live in the NPC blueprint.

avatar image badcat231944 Apr 11 '16 at 11:45 PM

When i try to put my function in my npc blueprint he wont move or wont connect to get controller :/.

avatar image badcat231944 Apr 12 '16 at 12:02 AM

Edit: plus i want to work with 60+ civil... :/ and i try to put make array but i wont let me put my character no 2: alt text

I just want to make run my 60+ character with the same function.. but make array can only connect one character... not the second one.. help :(

(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