# How to get location value from component transform?

**URL:** <https://forums.unrealengine.com/t/how-to-get-location-value-from-component-transform/430103>\
**Category:** C++\
**Tags:** value, unreal-engine, transform, CPP, question\
**Created:** [July 23, 2018, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-get-location-value-from-component-transform/430103 "2018-07-23T23:40:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LABS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LABS](https://forums.unrealengine.com/u/LABS)\
**Post date:** [July 23, 2018, 11:40pm UTC](https://forums.unrealengine.com/t/how-to-get-location-value-from-component-transform/430103/1 "2018-07-23T23:40:15Z")

</div>

Hi all,

I’m fairly new to C++ but have quite a lot of experience with blueprint. In C++ i’m trying to specifically get the Z value from a component’s transform. Essentially I want to break the transform, and get a single value from the transform’s location.

I’m able to get a specific value from a vector, such as:

```
ZVariable = LocationVector.Z;

```

But I’m clearly missing something when I attempt to extract the value from a transform. What am I missing here?

---

<div class="post-metadata">

**Author:** ![HarryHighDef](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HarryHighDef](https://forums.unrealengine.com/u/HarryHighDef)\
**Post date:** [July 24, 2018, 10:50am UTC](https://forums.unrealengine.com/t/how-to-get-location-value-from-component-transform/430103/2 "2018-07-24T10:50:17Z")

</div>

You can call

```
.GetLocation()

```

on your transform.

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [August 10, 2018, 6:15pm UTC](https://forums.unrealengine.com/t/how-to-get-location-value-from-component-transform/430103/3 "2018-08-10T18:15:37Z")

</div>

And then get the .Z from that, right?
