ForLoop not firing correctly
So I am using a box collision component inside a blueprint to get all overlapping actors when this rail gun is fired, then running a ForLoop (or ForEachLoop, neither is currently working) on all overlapping actors to spawn an explosion and deal damage. But, while the get overlapping actors node is returning all the overlapping actors (12 here) using that result in either a ForLoop or ForEachLoop is only firing 6 times. As you can see in the blueprint, I'm getting the length of the array and printing that result, 12, the first number printed in the screenshot, then immediately plugging that value into a ForLoop and printing the index each time it fires, which is 6 times.
Does anyone know what the heck is going on here? Am I missing something obvious?
Manually entering 12 in the ForLoop makes it work on all 12 guys, so I have no idea why plugging in the length wouldn't work.
asked Jan 12 '16 at 09:16 AM in Blueprint Scripting
Looks like I just fixed the problem by making an actor array variable and saving the overlapping actors to that, then using that variable in the ForEachLoop. Still doesn't make sense though why I can't use the direct result of the get all overlapping actors node.
answered Jan 12 '16 at 09:25 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here