thumbnail blueprint
blueprint

Optimized For Each with Break

  • Exposure: public
  • UE Version: 5.6

Aikar

June 8, 2026, 12:33 am

Optimizes For Each Standard Macro to simplify the loop, and support break with no performance loss if you don't use it.

Avoids Pure Function performance gotcha by copying the array to local variable. This solves an issue where performance is drastically impacted by feeding a pure function into the For Loop requiring manual cache.

Item is cached to not invoke further copies on array get

While it's ugly here on blueprintUE, it actually looks clean in editor.

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v
Versions
June 8, 2026
  1. got rid of by ref get since editor keeps complaining and trying to replace it, cache result instead.

  2. First commit

    See