# \#for-loop

**URL:** https://forums.unrealengine.com/tag/for-loop/6406.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [Map variable errors](https://forums.unrealengine.com/t/map-variable-errors/2485668)

<div class="topic-metadata">

**Author:** [@Bial](https://forums.unrealengine.com/u/Bial)\
**Replies:** 1\
**Last updated:** [May 1, 2025, 6:59pm UTC](https://forums.unrealengine.com/t/map-variable-errors/2485668 "2025-05-01T18:59:00Z")

</div>

Hi, I created map variable in blueprints. Strings are the keys and structes are the values. For some reason after I change Keys and Values, they are not update fully after looping throuth them…

---

## [Adding Custom Events To Widgets In A For Loop](https://forums.unrealengine.com/t/adding-custom-events-to-widgets-in-a-for-loop/2261582)

<div class="topic-metadata">

**Author:** [@befrf1331](https://forums.unrealengine.com/u/befrf1331)\
**Replies:** 2\
**Last updated:** [January 6, 2025, 10:31am UTC](https://forums.unrealengine.com/t/adding-custom-events-to-widgets-in-a-for-loop/2261582 "2025-01-06T10:31:19Z")

</div>

Sorry if this has been asked before. I’ve been trying to figure this out and I can find no apparent solution. So I’m making a character creation screen. I have a data table with all the classes in the game which gets ite…

---

## [For each loop in anim graph](https://forums.unrealengine.com/t/for-each-loop-in-anim-graph/462391)

<div class="topic-metadata">

**Author:** [@Max974](https://forums.unrealengine.com/u/Max974)\
**Replies:** 4\
**Last updated:** [October 26, 2024, 11:04am UTC](https://forums.unrealengine.com/t/for-each-loop-in-anim-graph/462391 "2024-10-26T11:04:09Z")

</div>

Hello, how can I make a for each loop in an anim graph to avoid things like this :

---

## [Where is FOR loop in Editor Utility Widget in UE 4.26.2?](https://forums.unrealengine.com/t/where-is-for-loop-in-editor-utility-widget-in-ue-4-26-2/483557)

<div class="topic-metadata">

**Author:** [@Cytrix86](https://forums.unrealengine.com/u/Cytrix86)\
**Replies:** 10\
**Last updated:** [July 24, 2024, 12:56am UTC](https://forums.unrealengine.com/t/where-is-for-loop-in-editor-utility-widget-in-ue-4-26-2/483557 "2024-07-24T00:56:15Z")

</div>

I cannot find FOR loop and other flow control commands in Editor Utility Widget in UE 4.26.2. Is it OK or bug? Is there other way to make for loop in Editor Utility Widget in UE 4.26.2?

---

## [How to decrement in For Loop with break](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969)

<div class="topic-metadata">

**Author:** [@Jil3R](https://forums.unrealengine.com/u/Jil3R)\
**Replies:** 3\
**Last updated:** [May 27, 2024, 11:09pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969 "2024-05-27T23:09:36Z")

</div>

Hello all, so after so many attempts, I could create a decrement for loop using unreal engine. so here is the blueprint screenshot. we can give the first index and last index. I have also added a delay and break also. I…

---

## [Can't Re-Enable collision through Construction Script](https://forums.unrealengine.com/t/cant-re-enable-collision-through-construction-script/1618528)

<div class="topic-metadata">

**Author:** [@Anthony\_Dimovski](https://forums.unrealengine.com/u/Anthony_Dimovski)\
**Replies:** 4\
**Last updated:** [January 18, 2024, 2:24am UTC](https://forums.unrealengine.com/t/cant-re-enable-collision-through-construction-script/1618528 "2024-01-18T02:24:59Z")

</div>

Hello, I’m having trouble with collisions not behaving as I expect it to Basically I have a road mesh + the sidewalks that are made up of multiple meshes The sidewalk meshes are grouped under a single mesh named ‘SideW…

---

## [What's the best way to save/load information about levels which can be edited in future game updates?](https://forums.unrealengine.com/t/whats-the-best-way-to-save-load-information-about-levels-which-can-be-edited-in-future-game-updates/1350763)

<div class="topic-metadata">

**Author:** [@Slydex44](https://forums.unrealengine.com/u/Slydex44)\
**Replies:** 4\
**Last updated:** [October 29, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/whats-the-best-way-to-save-load-information-about-levels-which-can-be-edited-in-future-game-updates/1350763 "2023-10-29T14:05:55Z")

</div>

Some time ago I developed a system which reads information about all levels from data tables and puts it in structs inside the game instance. I pull info from there to create a list of levels on the level selection scree…

---

## [How to \[For Each Loop\] thru Array of Data Table Handles, and repeat \[code\] for each handle?](https://forums.unrealengine.com/t/how-to-for-each-loop-thru-array-of-data-table-handles-and-repeat-code-for-each-handle/747530)

<div class="topic-metadata">

**Author:** [@XxNotAGamerxX](https://forums.unrealengine.com/u/XxNotAGamerxX)\
**Replies:** 1\
**Last updated:** [January 12, 2023, 8:28pm UTC](https://forums.unrealengine.com/t/how-to-for-each-loop-thru-array-of-data-table-handles-and-repeat-code-for-each-handle/747530 "2023-01-12T20:28:11Z")

</div>

UE4.27, Arrays, Loops, and Construction Scripts: How do I break down a "Data Table Row" Handle Array-variable (it’s not a Single row, but an array of 6 DT Row Handles), So that each Handle (in the Array, there …

---

## [Why does FString Append in loop use numbers from previous loop?](https://forums.unrealengine.com/t/why-does-fstring-append-in-loop-use-numbers-from-previous-loop/486390)

<div class="topic-metadata">

**Author:** [@TheThreeEyedLion](https://forums.unrealengine.com/u/TheThreeEyedLion)\
**Replies:** 2\
**Last updated:** [July 19, 2021, 1:51pm UTC](https://forums.unrealengine.com/t/why-does-fstring-append-in-loop-use-numbers-from-previous-loop/486390 "2021-07-19T13:51:09Z")

</div>

Hi, I think the problem lies with the Append function, but I can’t figure out why it does that? there is no problem, it is just how Append it works. FString MyString = "ABC"; MyString.Append("D"); MyString is now…

---

## [UMG is not Updated](https://forums.unrealengine.com/t/umg-is-not-updated/484865)

<div class="topic-metadata">

**Author:** [@Cem\_Czesch](https://forums.unrealengine.com/u/Cem_Czesch)\
**Replies:** 12\
**Last updated:** [June 15, 2021, 4:28pm UTC](https://forums.unrealengine.com/t/umg-is-not-updated/484865 "2021-06-15T16:28:34Z")

</div>

OK, The pertentage value on the widget is a value from 0 to 1, (Not 0 to 100 !), so after divide your generated chunks by chunks to generate, do not multiply \*100 again ! You only need a value from 0 to 1 so the resoult…

---

## [For loop doesn't work](https://forums.unrealengine.com/t/for-loop-doesnt-work/479239)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_98bf41d7](https://forums.unrealengine.com/u/anonymous_user_98bf41d7)\
**Replies:** 0\
**Last updated:** [February 28, 2021, 5:24pm UTC](https://forums.unrealengine.com/t/for-loop-doesnt-work/479239 "2021-02-28T17:24:48Z")

</div>

I want to loop these two rotations for 5 times but it only loops once.

---

## [Can't Add Force to multiple objects in array?](https://forums.unrealengine.com/t/cant-add-force-to-multiple-objects-in-array/478899)

<div class="topic-metadata">

**Author:** [@JohnKentFX](https://forums.unrealengine.com/u/JohnKentFX)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 5:59pm UTC](https://forums.unrealengine.com/t/cant-add-force-to-multiple-objects-in-array/478899 "2021-02-17T17:59:31Z")

</div>

Hi all, I am still rather new to blueprint and so if there is a better way to approach this please let me know. My current problem is that it doesn’t seem possible to add force to multiple objects at once. For visual ex…

---

## [For loop when given character Hit Result triggers multiple times](https://forums.unrealengine.com/t/for-loop-when-given-character-hit-result-triggers-multiple-times/471068)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_04b5ac74](https://forums.unrealengine.com/u/anonymous_user_04b5ac74)\
**Replies:** 20\
**Last updated:** [September 13, 2020, 10:53pm UTC](https://forums.unrealengine.com/t/for-loop-when-given-character-hit-result-triggers-multiple-times/471068 "2020-09-13T22:53:27Z")

</div>

I this is in a replicated Function on the character the problem is that the TakeDamage is called around 10 times making the character die instantly but when i trace for other objects like the FLOOR it only prints the st…

---

## ['FIND' function not finding empty index for Inventory](https://forums.unrealengine.com/t/find-function-not-finding-empty-index-for-inventory/470131)

<div class="topic-metadata">

**Author:** [@kiantheskorpion](https://forums.unrealengine.com/u/kiantheskorpion)\
**Replies:** 2\
**Last updated:** [August 23, 2020, 5:29pm UTC](https://forums.unrealengine.com/t/find-function-not-finding-empty-index-for-inventory/470131 "2020-08-23T17:29:51Z")

</div>

Hello Everyone, So I have been following the Ryan Laley tutorials on YouTube guided towards building an inventory system. After ending video 6, my Create Stack function is not working properly. It is supposed to find a…

---

## [C++ iteration, create materials and assign to landscape actors](https://forums.unrealengine.com/t/c-iteration-create-materials-and-assign-to-landscape-actors/459321)

<div class="topic-metadata">

**Author:** [@Alphenor\_3D](https://forums.unrealengine.com/u/Alphenor_3D)\
**Replies:** 0\
**Last updated:** [December 10, 2019, 2:46pm UTC](https://forums.unrealengine.com/t/c-iteration-create-materials-and-assign-to-landscape-actors/459321 "2019-12-10T14:46:53Z")

</div>

This is probably far fetched… But I am using World Composition, and have hundreds of tiles in my game (generated by world machine), each tile also has RGB files, used to generate layer weights in the respective materials…

---

## [Relative location for looped instances?](https://forums.unrealengine.com/t/relative-location-for-looped-instances/449281)

<div class="topic-metadata">

**Author:** [@Dark\_Jubei](https://forums.unrealengine.com/u/Dark_Jubei)\
**Replies:** 0\
**Last updated:** [May 20, 2019, 11:03am UTC](https://forums.unrealengine.com/t/relative-location-for-looped-instances/449281 "2019-05-20T11:03:20Z")

</div>

Hi All, I have a set of train seats that I’ve added to a blueprint as instances so I can use the same geometry throughout the scene. Fairly straight forward. Everything works well but I have these little tables on t…

---

## [Spawn actor not working (with code)](https://forums.unrealengine.com/t/spawn-actor-not-working-with-code/448817)

<div class="topic-metadata">

**Author:** [@Lazzercat05](https://forums.unrealengine.com/u/Lazzercat05)\
**Replies:** 1\
**Last updated:** [May 11, 2019, 8:08pm UTC](https://forums.unrealengine.com/t/spawn-actor-not-working-with-code/448817 "2019-05-11T20:08:40Z")

</div>

here the code, I am very confused, it worked before.

---

## [\[Feature Request\] Material editor loops](https://forums.unrealengine.com/t/feature-request-material-editor-loops/366633)

<div class="topic-metadata">

**Author:** [@SFtheWolf](https://forums.unrealengine.com/u/SFtheWolf)\
**Replies:** 13\
**Last updated:** [October 22, 2018, 11:30pm UTC](https://forums.unrealengine.com/t/feature-request-material-editor-loops/366633 "2018-10-22T23:30:42Z")

</div>

I’ve seen this discussed a lot but I’m surprised I couldn’t find a formal request. It’d be extremely useful to have while and for loops in the form of native material editor nodes. It would eliminate the need for custom …

---

## [ForLoop Replaced by a Macro Instance 4.20.3](https://forums.unrealengine.com/t/forloop-replaced-by-a-macro-instance-4-20-3/436114)

<div class="topic-metadata">

**Author:** [@sebaftw](https://forums.unrealengine.com/u/sebaftw)\
**Replies:** 0\
**Last updated:** [October 22, 2018, 10:05am UTC](https://forums.unrealengine.com/t/forloop-replaced-by-a-macro-instance-4-20-3/436114 "2018-10-22T10:05:34Z")

</div>

So last time I worked on my project I created a ForLoop that spawned MyActor a specific amount of times. A week goes by - I download my project and open it in Unreal. It instantly shows an error in the blueprint. So basi…

---

## [Feature Request: Smarter "ForLoop"](https://forums.unrealengine.com/t/feature-request-smarter-forloop/432543)

<div class="topic-metadata">

**Author:** [@Neilz0r](https://forums.unrealengine.com/u/Neilz0r)\
**Replies:** 1\
**Last updated:** [August 27, 2018, 12:15pm UTC](https://forums.unrealengine.com/t/feature-request-smarter-forloop/432543 "2018-08-27T12:15:41Z")

</div>

I noticed that the standard ForLoop Macro doesn’t behave correctly if you plug a larger integer (i.e. 20) into the “First index” and a smaller integer (i.e. 0) into the “Last Index”. A simple check at the beginning aft…

---

## [Shotgun damage problems](https://forums.unrealengine.com/t/shotgun-damage-problems/426324)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_bc417612](https://forums.unrealengine.com/u/anonymous_user_bc417612)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 11:01pm UTC](https://forums.unrealengine.com/t/shotgun-damage-problems/426324 "2018-06-01T23:01:16Z")

</div>

Hello, I’m having problems with my projectiles causing damage. I’m using a “For Loop” to spawn a bunch of projectiles, like a spread shot. All my Projectiles spawn and fire correctly. But when they hit the enemy pawn,…

---

## [How to create many UStaticMeshComponent's with a for loop?](https://forums.unrealengine.com/t/how-to-create-many-ustaticmeshcomponents-with-a-for-loop/424248)

<div class="topic-metadata">

**Author:** [@Ktbu](https://forums.unrealengine.com/u/Ktbu)\
**Replies:** 1\
**Last updated:** [May 3, 2018, 5:57pm UTC](https://forums.unrealengine.com/t/how-to-create-many-ustaticmeshcomponents-with-a-for-loop/424248 "2018-05-03T17:57:03Z")

</div>

UStaticMeshComponent\* Spike = CreateDefaultSubobject(TEXT(“Spike”)); Spike-\>GetComponentLocation() = NewLocation; static ConstructorHelpers::FObjectFinder SpikeAsset(TEXT(“StaticMesh’/Game/StarterContent/Shapes/Shape\_C…

---

## [How to edit elements created in for loop in Construction Script but in Event graph during run-time?](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572)

<div class="topic-metadata">

**Author:** [@dogrush](https://forums.unrealengine.com/u/dogrush)\
**Replies:** 4\
**Last updated:** [February 23, 2018, 9:24pm UTC](https://forums.unrealengine.com/t/how-to-edit-elements-created-in-for-loop-in-construction-script-but-in-event-graph-during-run-time/414572 "2018-02-23T21:24:03Z")

</div>

Hi there, I’m creating a group of lights through a for loop in Construction Script, and i need to affect the color of the lights in event graph during run time. I have attempted many ways, such as storing the created lig…

---

## [TArray iteration](https://forums.unrealengine.com/t/tarray-iteration/339912)

<div class="topic-metadata">

**Author:** [@Dirt113](https://forums.unrealengine.com/u/Dirt113)\
**Replies:** 6\
**Last updated:** [December 9, 2017, 2:12am UTC](https://forums.unrealengine.com/t/tarray-iteration/339912 "2017-12-09T02:12:13Z")

</div>

Is this iteration system correct? Or is there a more efficient way to do the search? /\*\* @returns list of most important checkpoints of overlapped \* \* @param IgnoredCheckpoints Checkpoints to exclude from search \*/…

---

## [Is while loop is cheaper than for loop?](https://forums.unrealengine.com/t/is-while-loop-is-cheaper-than-for-loop/404387)

<div class="topic-metadata">

**Author:** [@Tokodboy](https://forums.unrealengine.com/u/Tokodboy)\
**Replies:** 4\
**Last updated:** [September 13, 2017, 6:38am UTC](https://forums.unrealengine.com/t/is-while-loop-is-cheaper-than-for-loop/404387 "2017-09-13T06:38:53Z")

</div>

I read that for loop is an expensive operation because Loop iterations will take place between frames, so large loops may incur a performance hit. But what the matter with the While Loop? It is faster/cheaper then for? …

---

## [How can I rotate a line trace array?](https://forums.unrealengine.com/t/how-can-i-rotate-a-line-trace-array/402660)

<div class="topic-metadata">

**Author:** [@The\_Pedullist](https://forums.unrealengine.com/u/The_Pedullist)\
**Replies:** 2\
**Last updated:** [August 28, 2017, 2:44pm UTC](https://forums.unrealengine.com/t/how-can-i-rotate-a-line-trace-array/402660 "2017-08-28T14:44:26Z")

</div>

Hello Unreal Community! I have a blueprint question that has me stumped. I’m creating an editable grid for placing windows on a building using blueprints. The For Loop generates a 2D array and uses line traces to sn…

---

## [Delay in middle of ForLoop Body](https://forums.unrealengine.com/t/delay-in-middle-of-forloop-body/402608)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_dc2070b31](https://forums.unrealengine.com/u/anonymous_user_dc2070b31)\
**Replies:** 3\
**Last updated:** [August 23, 2017, 11:16am UTC](https://forums.unrealengine.com/t/delay-in-middle-of-forloop-body/402608 "2017-08-23T11:16:18Z")

</div>

Hi, I have been trying to make a blueprint where player needs to click a button and based on what button he clicks different actions happen. I cant manage to get working delay in for loop(where blueprint needs to wait f…

---

## [For Loop With Condition and increment/decrement](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951)

<div class="topic-metadata">

**Author:** [@EXCIR](https://forums.unrealengine.com/u/EXCIR)\
**Replies:** 2\
**Last updated:** [October 14, 2016, 11:07am UTC](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951 "2016-10-14T11:07:53Z")

</div>

Hey. I’m trying to make a macro for loop with condition and input for selecting increment or decrement index value. it doesn’t work at all. launching the macro cause system freeze and crash the unreal Play mode.I can’t…

---

## [(動画チュートリアル関連) ForLoopとは](https://forums.unrealengine.com/t/forloop/367975)

<div class="topic-metadata">

**Author:** [@ymars](https://forums.unrealengine.com/u/ymars)\
**Replies:** 1\
**Last updated:** [August 23, 2016, 4:54am UTC](https://forums.unrealengine.com/t/forloop/367975 "2016-08-23T04:54:07Z")

</div>

ForLoop の使い方を簡単に教えてください。index の意味などが使用例とともに説明されると助かります。 :arrow\_forward:関連する動画チュートリアル UE4 Blueprint Quickshot 12 - Random Streams (v4.7)

---

## [How do I make an Array be chosen randomly, but each actor at least once?](https://forums.unrealengine.com/t/how-do-i-make-an-array-be-chosen-randomly-but-each-actor-at-least-once/367683)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_1786a85d](https://forums.unrealengine.com/u/anonymous_user_1786a85d)\
**Replies:** 2\
**Last updated:** [August 20, 2016, 7:18pm UTC](https://forums.unrealengine.com/t/how-do-i-make-an-array-be-chosen-randomly-but-each-actor-at-least-once/367683 "2016-08-20T19:18:35Z")

</div>

Hello, I have connected up a random integer in range to a Get Actor Array which is plugged into a Spawn actor. This spawn actor is triggered by a for loop to spawn 25 actors in a grid. The Actor Array has 4 different ac…

[Next page](https://forums.unrealengine.com/tag/for-loop/6406.md?match_all_tags=true&page=1&tags%5B%5D=for-loop)
