# Save player location and teleport back to that location

**URL:** <https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042>\
**Category:** Community & Industry Discussion\
**Tags:** teleportation, teleport, unreal-engine, question\
**Created:** [January 4, 2016, 5:44am UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042 "2016-01-04T05:44:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SyncFx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyncFx](https://forums.unrealengine.com/u/SyncFx)\
**Post date:** [January 4, 2016, 5:44am UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042/1 "2016-01-04T05:44:25Z")

</div>

Hello,

I’m trying to figure out how to setup the following:

I’m on a ledge, I press E(double tap or single for now) now my character’s position is saved after pressing E.

I fall off the ledge, or go somewhere in the map, press another input(double tap F or single for now) and then my character teleports back to where I saved with E.

Any pointers or directions would be lovely!

---

<div class="post-metadata">

**Author:** ![Est\_engine](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/est_engine/32/1008648_2.png) [@Est\_engine](https://forums.unrealengine.com/u/Est_engine)\
**Post date:** [January 4, 2016, 1:30pm UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042/2 "2016-01-04T13:30:49Z")

</div>

Hi man ,  
You can store your location in a variable vector type.  
Add this vector call it “OLDlocation”.  
When you pressed “E” set the OLDlocation with your location with the node “get actor location.”  
When you press “F” set your actor world location to your OldLocation.

To use the key press you have to enable the input on that actor.  
If you are using a pawn you need to possess it.

---

<div class="post-metadata">

**Author:** ![SyncFx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyncFx](https://forums.unrealengine.com/u/SyncFx)\
**Post date:** [January 4, 2016, 2:43pm UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042/3 "2016-01-04T14:43:13Z")

</div>

Hello, thank you for the reply, I manged to get it working with the following image:

 ![72793-checkpoint-teleport.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/c/49c98d6d05b433e47db1d8d198b28cee3ff165b5.png)

However, as you can see with the last set of code, is that when I press E, it is destroying everything including the one I just spawned. I’m wanting to destroy all in the world/map but the one I just spawned, any ideas?

---

<div class="post-metadata">

**Author:** ![Est\_engine](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/est_engine/32/1008648_2.png) [@Est\_engine](https://forums.unrealengine.com/u/Est_engine)\
**Post date:** [January 4, 2016, 3:11pm UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042/4 "2016-01-04T15:11:37Z")

</div>

First, if you have just one checkpoint. there is no purpose in using an array .  
You should just relocate your checkpoint. instead of spawning it

If you want more than one check point , and your question is how i keep the last i used.  
Since we dont know in wich way the get all actor of class order the checkpoint.  
You could just get their location first, check wich one is the nearest, and kill all but that.

However **i suggest you to keep just 1 checkpoint** spawned, or just **use a variable in your char. to store the checkpoint location.**

---

<div class="post-metadata">

**Author:** ![AURORA\_GAMEWORKS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AURORA\_GAMEWORKS](https://forums.unrealengine.com/u/AURORA_GAMEWORKS)\
**Post date:** [August 27, 2019, 11:53am UTC](https://forums.unrealengine.com/t/save-player-location-and-teleport-back-to-that-location/343042/5 "2019-08-27T11:53:21Z")

</div>

We’ve create a tutorial video on the subject. However our tutorial is completely specialised on the subject of player location saving, including things like making sure to not save player location whilst the player is in mid air, only saving once the player has landed on solid ground.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/7/8a7a72e283a4e43d3d81a340ab0af538996b6a47.jpeg "UE4 Tutorial - Saving Player Location") ](https://www.youtube.com/watch?v=i-OJW1fZd4E)
