Simulate travel on a vehicle in VR, by moving the VR origin around.

Here are methods to move the player around as if they were on a moving platform e.g attached to a vehicle, in this case, a Zepplin. There are 2 methods here, the first is for a solo VR user using the regular VIVE or Oculus VR tracking, the second for cases when the Optitrack system is used in a live VR context like DAZZLE2020

REGULAR VR TRACKING E.G VIVE, OCULUS

  • For this method, I have a GameMode set up called BRUNOGameModePlayerOnBlimp that calls a custom Pawn = BRUNOMotionControllerPawnMove which itself is based on the MotionControllerPawn from the Unreal VR content examples.
  • For the moving parts, I have a Zepplin that is a mesh with a platform under it. The Zepplin is a BP and has a script to follow along a spline path which I adapted from the tutorial here: https://www.youtube.com/watch?v=bWXI91FdMtk
  • I also have set up a global variable Zep Position using this game instance method here: http://gibsonmartelli.com/SpacePlace/2018/04/05/global-variable-in-unreal/
  • I’m setting the Zep Position variable to the Zeppelins position here in the Zepplin BP
send Zepplin position to a “Global” variable…
  • in my Pawn I add a capsule collision (not sure why).
Add capsule to pawn
  • Add some blueprint nodes into the pawn like so:
Make the pawn position the same as the vehicle
  • Basically in BRUNOMotionControllerPawnMove pawn I set the Default Scene Root to be the same as the Zep position and I split the Zep Rotation and add Local rotation to my actor. This is so that when the Zepplin turns a corner the world appears to turn for the player.

OPTITRACK VR TRACKING

  • This is for when the Optitrack is replacing the headset tracking and you want the audience and/or the performers to be on a moving platform or vehicle. For this method, you move the whole Optitrack origin, not the player VR Pawn. This has an advantage as you don’t need to make a custom pawn.
  • It’s much the same as the first method however with a few key differences. Set up the moving platform or in my case, Zepplin, to do a spline path follow. Then still in the Zepplin BP do the follwing…
  • First set up an Attach to Actor. Normally this node attaches the containing actor to another as a child. However we want the other way around, so our Optitrack Origin is the passenger of the Zepplin. Make the Target and the Parent Actor into variables and expose them, we will select the target and parent in the level. Presumably, we can turn this on and off so that the origin can be set to moving only in certain scenes.
Attach to Actor
Exposed variables so we can set in the level
  • Next we set the ‘passenger’ translation &rotation from the spline following part…
Passenger location, rotation
Heres the whole Zepplin BP for reference
Zep details
  • in the level you have to set the two references, one for the Zepplin Passenger – in this case, the OptitrackClientOrigin1 and the Me The Zep reference is set to the Zepplin itself.
  • There is probably an elegant solution to get a reference to itself internally but I don’t know it.
  • It occurs to me that if we have multiple OptitrackClientOrigins then a live performer can be set to use that second origin, which can, in turn, be a passenger on a different vehicle.