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 make custom event fire in all copies of blueprint?

So I have "Get all actors of class" -> "Get (a copy)" -> Custom event,

In the target pawn blueprint (It's an AI enemy) I have custom event -> print string 'hello'

Now I have many copies of this pawn blueprint in my level, but the 'hello' only prints once from one of them.

How do I make it so that all of the copies will print string hello?

I'll clarify further if something was unclear, thanks in advance.

Product Version: UE 4.21
more ▼

asked Mar 14 '19 at 01:28 AM in Blueprint Scripting

avatar image

16 3 1 2

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

1 answer: sort voted first

You have to do a ForEachLoop and use the Get All Actors of Class node as the Array. The ForEachLoop will run for as many times as there is a valid actor (spawned in map) to loop through.

more ▼

answered Mar 14 '19 at 01:30 AM

avatar image

IEI Game Studios
241 2 5 5

avatar image rokkie199 Mar 14 '19 at 01:38 AM

Thanks! It worked perfectly :)

avatar image IEI Game Studios Mar 14 '19 at 08:39 PM

No problem! You want to be careful with for each loops tho! If you use a magnitude of ForEachLoops on Event Ticks or even Event Begins, you can cause Lag or even game crashes. Use them sparingly.

(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