# Take the location X,Y,Z of an object and add plus 30 to the X. Then using TeleportTo, to that location.

**URL:** <https://forums.unrealengine.com/t/take-the-location-x-y-z-of-an-object-and-add-plus-30-to-the-x-then-using-teleportto-to-that-location/1772839>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 26, 2024, 11:02am UTC](https://forums.unrealengine.com/t/take-the-location-x-y-z-of-an-object-and-add-plus-30-to-the-x-then-using-teleportto-to-that-location/1772839 "2024-03-26T11:02:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kelan](https://forums.unrealengine.com/u/Kelan)\
**Post date:** [March 26, 2024, 11:02am UTC](https://forums.unrealengine.com/t/take-the-location-x-y-z-of-an-object-and-add-plus-30-to-the-x-then-using-teleportto-to-that-location/1772839/1 "2024-03-26T11:02:44Z")

</div>

Take the location X,Y,Z of an object and add plus 30 to the X. Then using TeleportTo, to that location.  
🙂

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [March 26, 2024, 3:35pm UTC](https://forums.unrealengine.com/t/take-the-location-x-y-z-of-an-object-and-add-plus-30-to-the-x-then-using-teleportto-to-that-location/1772839/2 "2024-03-26T15:35:35Z")

</div>

Hi Kelan,

Try implementing the system in this [community video](https://www.youtube.com/watch?v=J7f2zHJbcUg). It uses MoveTo(), but I think knowledge would be transferrable for TeleportTo(). Hope that helps.

---

<div class="post-metadata">

**Author:** ![ifraser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ifraser](https://forums.unrealengine.com/u/ifraser)\
**Post date:** [June 20, 2024, 1:21am UTC](https://forums.unrealengine.com/t/take-the-location-x-y-z-of-an-object-and-add-plus-30-to-the-x-then-using-teleportto-to-that-location/1772839/3 "2024-06-20T01:21:01Z")

</div>

In order to get the location of an object you can use

```auto
MyPosition:vector3= GetTransform().Translation

```

To add to a vector there are a few options.  
You can always add two vectors together

```auto
V1:vector3= vector3{X:=0.0, Y:=0.0, Z:=0.0}
V3:= V1 + vector3{X:=30.0, Y:=0.0, Z:=0.0}

```

now V3 is V1 plus 30 in X.

And if you wanted to make a helper function to do this lots you could do

```auto
(V:vector3).AddX(XOffset:float):vector3=
    return vector3{X:=V.X+XOffset, Y:=V.Y, Z:=V.Z}

VectorAdditionTest():void=
    V1:vector3= vector3{X:=0.0, Y:=0.0, Z:=0.0}
    V2 := V1.AddX(30.0)

```

Which takes the components of the original vector and adds the offset passed in to the X component.

You can then roughly use something like this to teleport the obj, wit the same rotation it currently has (where Pos is a vector3)

```auto
if (PropObject.TeleportTo[Pos, GetTransform().Rotation]):
            Print("Teleported to:{Pos}")

```
