Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Predefined teleporting through keypress in VR

Hey Everyone! So i set up a basic VR Environment from the standard templates and created a little university project with it (not game design related). Everything works good so far (HTC Vive).

Now i want to implement a function but i dont know how (sorry, absolute beginner): I want to move the character/player to specific, pre-defined positions on the map through simple button presses on the keyboard.

Example given: pressing 1 on the keyboard teleports me to Point A, from where i can look around and use normal teleporting movement with the vive controllers. Same goes for pressing 2, but it teleports to point B and so forth.

What and how is the easiest way to do it?

Extra: can i specify the direction of looking when teleporting the player?

Thank you very much!

with best regards, max

Product Version: UE 4.18
more ▼

asked Feb 25 '18 at 11:48 PM in Blueprint Scripting

avatar image

3 2 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

the easiest way to accomplish the teleporting to a location would be to have an actor such as a target point placed in your level for each location. then in the level blueprint have a script where when the number button is pressed it sets the actor location from the target points location. below youll see how to do this.

alt text

i cant say for sure on the setting the rotation since i dont have any vr equipment to test with but i would suggest starting by trying set actor rotation similar to the set location above or set control rotation which would involve getting the player controller. one of those options would probably work. also you may want a fade to black transition for while teleporting (cuz you know vr). these are just ideas in this paragraph because my vr knowlege is limited.

capture.png (260.3 kB)
more ▼

answered Feb 26 '18 at 12:06 AM

avatar image

10.1k 33 10 25

avatar image ThompsonN13 Feb 26 '18 at 12:16 AM

i also created a few examples where by pressing one button you can cycle through the locations in order. press button once go to location 1, press again go to location 2, etc. then when you reach the last location and press the button again you go to location 1 and start the loop again.

alt text

alt text

capture.png (291.0 kB)
capture2.png (269.0 kB)
avatar image smax87 Feb 26 '18 at 09:55 PM

First of all, thanks a lot! It didn't work exactly like you said, because it couldn't adress the GetPlayerCharacter, which i think is because of the nature of the VR Template, using a pawn entity. I just exchanged the "Get Player Character" blueprint to "Get Player Pawn" and voila - works like a charm. Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question