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"

ForEachLoop ignores the last element

Hi! Looks like the foreachloop iterates not over all elements in array. I've made 3 target points and made an array of vectors out of them. The loop iterates over 2 vectors and the third one is ignored. Why does it happens? Thanks for any suggestions. My level blueprint looks like that: alt text

Product Version: UE 4.5
Tags:
crabbp.png (310.1 kB)
more ▼

asked May 21 '15 at 03:14 PM in Blueprint Scripting

avatar image

fuzz0
5 2 4

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

2 answers: sort voted first

The issue you're encountering is actually the way ForEachLoop is suppose to work. The problem is that it is attempting to move to all 3 locations at the same time. It is passing all 3 values through, instead of doing it one at a time. I put together a way that you could loop this movement, but it involves adding trigger volumes where the markers are.

alt text

Hope this helps!

Matthew Clark

more ▼

answered May 22 '15 at 06:50 PM

avatar image fuzz0 May 22 '15 at 07:16 PM

Thanks a lot!!! That works!

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

Hi fuzz0,

I recreated this, sort of, in a new project but it is going through each one. Could you set up some print strings to see if it is actually iterating on the last vector or not? This is how mine looks and it outputs in order after every second.

alt text

If simple print strings work, then the issue may be somewhere else in the blueprints.

more ▼

answered May 21 '15 at 07:41 PM

avatar image fuzz0 May 21 '15 at 08:25 PM

Hi! Thanks a lot for reply. I can confirm that your blueprint works fine, I have recreated it in my projects and everything seems alright. Unfortunately, my version do not work anyway.

avatar image Matthew J May 21 '15 at 08:27 PM

There isn't much difference in both of our loops, so it should technically work. The problem may be elsewhere. Can you provide me with more screenshots of your blueprint(s) or, if possible, a copy of the project itself?

avatar image fuzz0 May 21 '15 at 08:51 PM

Can I send the project via dropbox? zip file is 6.2 mb, so non possible to attach it here. All the logic is in Level Blueprint. link text

avatar image Matthew J May 21 '15 at 08:52 PM

That'd be perfectly fine. You can either link it here if you don't mind it being public, or send me a private message on the forums. My forum username is matthew_clark

avatar image fuzz0 May 21 '15 at 09:13 PM

All the logic is in Level Blueprint. The link: Dropbox project:

(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