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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

What is the best way of doing a radius foreach loop in blueprint?

Hi I'd like to check for pawns with in radius of an actor in blueprint, whats the best way of doing this now?

All the best


Product Version: Not Selected
more ▼

asked Jul 24 '14 at 11:53 AM in Blueprint Scripting

avatar image

63 5 8 12

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hi Showster,

You can use the 'get all actors of class' node to get an array of objects you want, and feed that into a for each loop. From there, use the 'get path length' node, giving the path start and end values as the locations of the central actor and the pawn to be checked, and compare that length to your radius.

Here's what the blueprint would look like:

alt text

compare_radius.png (112.3 kB)
more ▼

answered Jul 24 '14 at 12:26 PM

avatar image

86 6 7 10

(comments are locked)
10|2000 characters needed characters left

Additionally, you can do a sphere trace for objects if you are not worried about getting things above or below you.

more ▼

answered Jul 24 '14 at 12:56 PM

avatar image

1.8k 130 68 110

(comments are locked)
10|2000 characters needed characters left
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