# Sweep only works with Root component?

**URL:** <https://forums.unrealengine.com/t/sweep-only-works-with-root-component/319976>\
**Category:** Blueprint\
**Tags:** sweep, root, root-component, unreal-engine, Blueprint, question\
**Created:** [May 28, 2015, 5:13am UTC](https://forums.unrealengine.com/t/sweep-only-works-with-root-component/319976 "2015-05-28T05:13:12Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![anonymous\_user\_5a95298e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5a95298e](https://forums.unrealengine.com/u/anonymous_user_5a95298e)\
**Post date:** [August 5, 2016, 3:02pm UTC](https://forums.unrealengine.com/t/sweep-only-works-with-root-component/319976/13 "2016-08-05T15:02:14Z")

</div>

I had this problem, found this thread and decided to write a function that solves it

It calculates offset between current and desired root transform, sweeps all children by that amount, finds shortest sweep time, puts children back where they were and moves root by original offset multiplied by smallest sweep time

May be useful for other who had this problem, feel free to optimize it

 ![101636-sweephierarchy.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/e/23e180b1e863567c47f0f1568a9422e7a0605e6c.png)

---

_[View the full topic](https://forums.unrealengine.com/t/sweep-only-works-with-root-component/319976)._
