Not trivial but doable! I am assuming your are working on the basis of the default VR template, so here is how you can do it.
- You cannot make real “holes/open edges” because that would affect your Nav Mesh. In order for you to be able to teleport on the hole/open edge and fall through it, the hole/open edge has to be covered by the Nav Mesh.
- You cannot use Trigger Volumes or anything similar to detect when you are on the hole/edges because your VR Pawn has no body and no physics, so that would not work.
The solution is to use hidden in game actors to cover the holes/open edges so that the Nav Mesh can still span over them, tag them with a special “Hole” tag and then use a downward Line Trace from your VR Camera position to check if you have teleported yourself onto them. If that is true, then you can start the falling sequence and a camera fade to black to communicate that dying sensation…
Here is how the level looks like (without and with the Nav Mesh). The red actors represent the falling edges and are tagged with “Hole”. They are Hidden in Game.
Once the setup is ready, you can go to the Event Tick of your VR Pawn, add a pin to its Sequence node (the one from the default VR Template has already a couple of branches to manage the teleport rotation for each controller) and use this code.
You will also have to define the isFalling variable (boolean, set initially to false) and the Falling Speed variable (float, I set mine to 10.0).
Last but not least you need a curve to drive the timeline. Here is how mine looks like. 3 seconds of pure panic.