# Get relative Location from other component?

**URL:** <https://forums.unrealengine.com/t/get-relative-location-from-other-component/119274>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 27, 2018, 6:28am UTC](https://forums.unrealengine.com/t/get-relative-location-from-other-component/119274 "2018-11-27T06:28:45Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![anonymous\_user\_0ba2eb3c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0ba2eb3c](https://forums.unrealengine.com/u/anonymous_user_0ba2eb3c)\
**Post date:** [November 27, 2018, 6:59pm UTC](https://forums.unrealengine.com/t/get-relative-location-from-other-component/119274/4 "2018-11-27T18:59:39Z")

</div>

To transform from world location to relative location use [FONT=courier new]InverseTransformPosition:

```auto

FVector relativeLoc = GetTransform().InverseTransformPosition(myComponent->GetComponentLocation());

```

To transform from relative location to world location use [FONT=courier new]TransformPosition:

```auto

FVector someRelativeLoc;
FVector worldLoc = GetTransform().TransformPosition(someRelativeLoc);

```

Hope to have helped 🙂

---

_[View the full topic](https://forums.unrealengine.com/t/get-relative-location-from-other-component/119274)._
