Hello, I am a beginner to the Unreal Engine and game design in general. Part of the project I am working on involves creating a movement system for our VR tour using the HTC Vive. My team has decided to use a movement system using the MotionControllerMap template, but want to have fixed areas where the user can teleport to simplify movement, rather than letting the player freely teleport around the level. We want it to work like the Postcards level in The Lab.
My initial idea was to create a blueprint class of box triggers as the area markers, and disable movement unless the ArcEndPoint or TeleportCylinder meshes overlapped with a box trigger (using IsOverlappingActor.) I have not been having much luck with this so far and would like confirmation that this is a good idea or if I should be taking another approach. If this is a good idea, what are the correct collision settings for both classes to make the ArcEndPoint or TeleportCylinder overlap with the box trigger? For reference, we are using Unreal Engine 4.17.
Any help would be greatly appreciated.
Check this project out. It has multiple teleport systems including one like you described.
Beside what was recommended above by@wickerman123 , consider that in the Standard VR template - MotionControllerMap the teleportation mechanism relies on the NavMesh to find suitable locations to teleport to. You can use the Nav Modifier Volumes to exclude some areas and thus limit where you can teleport to.
Another approach is to define the exact spots your player can move to (location and orientation) and link them in a sequence, so one can move through them in a sort of guided tour (next point / previous point).
Easier to build from scratch.
Create a new Pawn with just the Default Scene root, Camera, two motioncontrollers (set to left and right).
Attach a Static mesh component to each of the Motioncontrollers and set the mesh to what you want it to be.
Create a class “VR_TeleportLocation” with a box/sphere collider in it and whatever mesh you want to be shown.
In the Pawn, create a Linetrace by channel “Visibility” split the “out hit” struct pin
from the “out hit hit actor” use a “Get class” and do an Equals to the VR_TeleportLocation class. Branch from there, if true set your hit actor to a variable.
Whenever you want to teleport (for example activate the scanline on trigger press and then teleport on release) you just check that your variable is valid “IS VALID” event… and if it is, get worldlocation and set your Pawns world location to that location.
Heres my blueprint for a simple one (it has some more functions when it comes to hitting a teleportlocation, such as changing the material and making it active… also checking if im hitting the same location twice etc.
If you want a Arcing teleport, check out this tutorial https://www.youtube.com/watch?v=EeNNoXfZgxo