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"

ForEach loop variable resetting before completion

alt text

I am developing a macro to calculate a moving average to smooth out some sound amplitude data, and I am running into a problem where the "Running Sum" variable below remains 0, does not get updated through the course of the ForEach loop, as if it is being reset on every step of the loop.

What am I doing wrong?

Thanks in advance!

Product Version: UE 4.19
average-calc.png (143.6 kB)
more ▼

asked Apr 14 '18 at 09:35 PM in Blueprint Scripting

avatar image

1 1 1

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

1 answer: sort voted first

Haven't done too much with macros but doesn't that "Assign" need to be connected to the output as it is the "loop body"? Because to me this seems like the only time you will have an "output" variable from this macro is when the loop is "completed" since that is the only execution pin that actually heads toward what I assume to be the "output" node. So basically this loops through. sets the variable over and over again but you never see that as an output because it actually never gets "outputted" from this macro until the entire loop is complete, at which point it flows through the complete execution pin, resets the variable to 0 and finally "outputs" the result, which is always going to be 0.....

more ▼

answered Apr 15 '18 at 12:39 AM

avatar image

Nebula Games Inc
5.4k 28 9 15

(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