# Teleporting the VR-player by Keyboard input

**URL:** <https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049>\
**Category:** XR Development\
**Tags:** unreal-engine\
**Created:** [December 15, 2019, 2:28pm UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049 "2019-12-15T14:28:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7b5d0c92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7b5d0c92](https://forums.unrealengine.com/u/anonymous_user_7b5d0c92)\
**Post date:** [December 15, 2019, 2:28pm UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049/1 "2019-12-15T14:28:52Z")

</div>

hi there

So I’m relatively new to the Unreal editor, which is why I couldn’t find a specific answer for my question, but instead like a million with various outcomes and variables. So maybe you guys can help me, I think my problem is very trivial in nature.  
I recently introduced VR to my boss, he’s fascinated by it and wants to show it to the customers. I set up a world, placed a working VR pawn, did the appropriate NavMesh-work etc, it works like a charm.

What I need to do now is I have 4 different locations on this map that I need to show the customers. These positions are not reachable by the default teleporting mechanism that you do with the motion controller. Since I will be monitoring the customer during the VR experience, I want to be able to teleport him to the 3 other locations by pressing buttons on the keyboard. Simple, 1 for position 1, 2 for position 2, etc.

**-Would you recomment copying the VR-Pawn four times and do it by possessing/unpossessing and would you kindly show me how to set up the blueprint?**

**-Or would you simply take the one Pawn and teleport it to the 3 other locations by button press?** I would like that more, to be honest.  
Is it possible to define three points on my world and tell the pawn to move to them by button press? Say I press Enter, it moves to the next point. Like a quick transition, not an instant blink.

Actually I’d love to create something like the spheres in Valve’s VR-Lab, which you have to pick up and put into your face to be teleported to another location/level, but my time is limited, also I don’t need to teleport to another level.

Can you help me?

---

<div class="post-metadata">

**Author:** ![vr\_marco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vr_marco/32/1194556_2.png) [@vr\_marco](https://forums.unrealengine.com/u/vr_marco)\
**Post date:** [December 15, 2019, 4:43pm UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049/2 "2019-12-15T16:43:28Z")

</div>

It’s pretty easy actually.

- Create a blueprint actor which represents the target location for the move. Let’s call it BP\_Target. Place as many as you need around your level.
- Next, from the level Blueprint, on Begin Play, do a Get All Actors of Class BP\_Target and fill in an array with them. Save to a variable. Let’s call it Target\_Array.
- Define an integer which represents the current target. Let’s call it current\_target. Initially it is 0.
- In your Level BP, track the Enter input key event. When Enter is pressed, increase the current\_target integer. If its above the total number of BP\_Targets you placed in the level, roll it back to 0.
- Then do a Get(current\_target) from the Target\_Array. The result is the next BP\_Target to move to. Get its World Location and store it as Destination\_Location.
- Now do a Set Actor World Location for your pawn setting Destination\_Location as your target location.

As a further level of sophistication you can also define a direction, so when teleported your player will look in a given direction. The principle is the same but you need to work with Rotations instead of Locations.

Good luck with your project!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7b5d0c92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7b5d0c92](https://forums.unrealengine.com/u/anonymous_user_7b5d0c92)\
**Post date:** [December 15, 2019, 5:29pm UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049/3 "2019-12-15T17:29:02Z")

</div>

Wow, thank you for the answer. Just by reading, I have a lot of questions. I’ll have to do it step by step and see if it works out. Might create a little testing level for this.  
If I have further questions, I will come back at you. Thanks again!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7b5d0c92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7b5d0c92](https://forums.unrealengine.com/u/anonymous_user_7b5d0c92)\
**Post date:** [December 16, 2019, 9:30am UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049/5 "2019-12-16T09:30:35Z")

</div>

> [@vr\_marco](#):
>
> do a Get All Actors of Class BP\_Target and fill in an array with them.

So far so good, but there seem to be different types of arrays. Which kind do I choose?

Would you mind showing me a screenshot of what the nodes should look like?

_edit_

Hold on for just a second. There is an actual teleport function that does exactly what I need. It’s very simple and self explanatory to set up.[https://youtube.com/watch?v=bTLK62dgPPAYour](https://youtube.com/watch?v=bTLK62dgPPAYour) solution seems way more complicated, but what is the difference?

---

<div class="post-metadata">

**Author:** ![vr\_marco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vr_marco/32/1194556_2.png) [@vr\_marco](https://forums.unrealengine.com/u/vr_marco)\
**Post date:** [December 16, 2019, 1:59pm UTC](https://forums.unrealengine.com/t/teleporting-the-vr-player-by-keyboard-input/135049/6 "2019-12-16T13:59:33Z")

</div>

> [@anonymous\_user\_7b5d0c92](#):
>
> So far so good, but there seem to be different types of arrays. Which kind do I choose?
> 
> Would you mind showing me a screenshot of what the nodes should look like?
> 
> _edit_
> 
> Hold on for just a second. There is an actual teleport function that does exactly what I need. It’s very simple and self explanatory to set up.[https://youtube.com/watch?v=bTLK62dgPPAYour](https://youtube.com/watch?v=bTLK62dgPPAYour) solution seems way more complicated, but what is the difference?

Get All Actors of Class returns an array. You have to turn that array into a variable (right click Promote to Variable) and the type will be automatically assigned. It will be the same type of the class you are using in the Get All Actors of Class function.

What I suggested you is a generalization of what you see in that tutorial. Instead of having one single teleportation destination, you have multiple ones in a sequence. This is what you asked for.
