# Bug: Move Component To not working with foreach

**URL:** <https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489>\
**Category:** Cinematics & Media\
**Tags:** move, move-component-to, unreal-engine, Array, component, question\
**Created:** [August 20, 2014, 9:06am UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489 "2014-08-20T09:06:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![intoxicat3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@intoxicat3](https://forums.unrealengine.com/u/intoxicat3)\
**Post date:** [August 20, 2014, 9:06am UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/1 "2014-08-20T09:06:51Z")

</div>

-(–4.4 from github. Take a look at the picture - Move Component To will only move ONE static mesh component, not all for the array.

 ![13232-move+component+bug.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/7/4970f89aab0c582dc6a8855a9d66ad32f54a8f6f.png)

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 20, 2014, 3:36pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/2 "2014-08-20T15:36:34Z")

</div>

Hi intoxicat3,

Exactly how and where did you setup your array?

---

<div class="post-metadata">

**Author:** ![intoxicat3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@intoxicat3](https://forums.unrealengine.com/u/intoxicat3)\
**Post date:** [August 20, 2014, 4:28pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/3 "2014-08-20T16:28:50Z")

</div>

Added all of the static meshes with ADD block - when I log everything in the array - the static mesh components are there, but Move Component To move only ONE - the first mesh in the array.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [August 20, 2014, 7:07pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/4 "2014-08-20T19:07:36Z")

</div>

Hi intoxicat3,

I was able to reproduce what you are seeing and the reason there is an issue is because the MoveComponentTo node uses latency.

Most people think that if they do a latent function in a ForLoop, the next iteration of the loop won’t run until the latent ends. But what actually happens is it will get into the latent, and then do the loop for the next item.

I spoke with one of our senor programmers and he said this is an issue he runs into as well. He is looking into perhaps adding this functionality in a future release.

Thanks, TJ

---

<div class="post-metadata">

**Author:** ![teason22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@teason22](https://forums.unrealengine.com/u/teason22)\
**Post date:** [January 31, 2015, 8:34pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/5 "2015-01-31T20:34:49Z")

</div>

Hello TJ,

Is there a suggested method of implementing this behaviour while we wait for that future functionality?

Thanks.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [February 4, 2015, 4:41pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/6 "2015-02-04T16:41:07Z")

</div>

Hi teason22,

Well, it depends on exactly what you are trying to do. Could you post some screenshots and a description?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_586d8a2c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_586d8a2c](https://forums.unrealengine.com/u/anonymous_user_586d8a2c)\
**Post date:** [April 28, 2015, 2:13pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/7 "2015-04-28T14:13:46Z")

</div>

I’ve had some issue with Move Component To as well. It seems that once it moves something to it’s completion, it stops working from that point on.

For instance, I used one for a Elevator. It used Begin Overlap to start playing and End Overlap to reverse back to the ground. It moves 900 units into the air. And it worked great… as long as you jumped off before it reached it’s final destination. Staying on it until it reaches the top and it would never respond to any overlap again. I could jump off half way, and it would move right back to where it started, perfectly. But if I let it take me all the way up, it was dead. It wouldn’t go back down or respond to anything else. It’s like it got broken as soon as it reached the top and could never respond again.

If you change locations it does seem to work. For another example, I’ve used Move Component To as a transport beam, to shift my character across the level. In this case, it moves me everytime and always works. I think that, because the destination is always changing, it resets the Move Component To, and it works again. But if the destination is always the same, it breaks on arrival.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2db7ca80](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2db7ca80](https://forums.unrealengine.com/u/anonymous_user_2db7ca80)\
**Post date:** [June 7, 2016, 9:57am UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/8 "2016-06-07T09:57:59Z")

</div>

I am having a similar problem - I was well aware that for each loops continue without pausing on the latent action, but I wasn’t able to trigger a whole bunch of move to’s at once because the last one overrides all the others. What is the correct work around for this?

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [June 7, 2016, 6:54pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/9 "2016-06-07T18:54:46Z")

</div>

Hi ,

I’m not ‘exactly’ sure what you are trying to do, but if you want to have multiple components in a blueprint to each use a Move To simultaneously, you could just use a Sequence node.

If that won’t work with your setup, can you give me some more info on exactly what you are trying to accomplish? Feel free to include a screenshot of you blueprint setup.

---

<div class="post-metadata">

**Author:** ![Rusbaron](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Rusbaron](https://forums.unrealengine.com/u/Rusbaron)\
**Post date:** [October 1, 2021, 12:53pm UTC](https://forums.unrealengine.com/t/bug-move-component-to-not-working-with-foreach/291489/10 "2021-10-01T12:53:59Z")

</div>

Is there any news?)
