VR Template w/ - Sept 29 - Live from Epic HQ

Modifying the Blueprints

For both #1 and #2, the answers are in the sweet, sweet Blueprints which have been created for this template.

**#1: This is already happening when you pick up the blue cubes in the “MotionControllerMap” found under “Content/VirtualRealityBP/Maps”.
**
If you notice when the motion controller “hand” gets close to an object, it changes pose, rumbles, and most importantly allows you to pickup and drop the blue cube it is close to. This is all outlined in the “GrabActor” function of the “BP_MotionController” blueprint found in “Content/VirtualRealityBP/Blueprints”. You might have also noticed that you cannot pickup just any actor in this level.

So if you want to be able to pickup/drop a gun, you will need to:

  1. Make an actor similar to the “BP_PickupCube” found under “Content/VirtualRealityBP/Blueprints”. You can simply duplicate the blueprint, give it a fancy gun name (I like “MasterBlaster”), then open it replace the mesh to your gun mesh and (optional) update the collision mesh from sphere.
  2. After you create the new gun blueprint, just place that new blueprint in the level (make sure it is above the ground!)
  3. Launch and have fun!

#2: There are two blueprints which are affecting the teleport rotation: “BP_MotionController”, which looks to be the meat and potatoes of the actual rotation functionality and “MotionControllerPawn”, which looks to be giving the other blueprint instructions on how to rotate.

So knowing that, you can either change the instructions that are being given (MotionControllerPawn) or change how those instructions are being received (BP_MotionController) or some combination of both.

The easiest way is to change the instructions being given so that it is always giving the rotation you want (0,0,0).

To change the rotation being given:

  1. Open MotionControllerPawn found in “Content/VirtualRealityBP/Blueprints”.
  2. In the Event Graph, you will see a setter for “Teleport Rotation”. What this is doing is setting the 'Teleport Rotation" value of the “BP_MotionController” blueprint to the value received from the motion controller thumbstick (Vive touch pad).
  3. To stop this from happening, you can make sure that it always sets it to nothing. To do this, use the “Make Rotator” and then connect it to the “Teleport Rotation” input of the setters for both the right and left hand sections.

To change how the rotation is being received:

  1. Open the “BP_MotionController” blueprint found in “Content/VirtualRealityBP/Blueprints”.
  2. If you look at the variables tab, you will see a variable named “TeleportRotation”. Right-click on this and select “Find References”.
  3. The search will return 2 places this variable is being used in this specific blueprint: “UpdateArcEndpoint” and “GetTeleportDestination”.
  4. So under the “Teleportation” category of the Functions, you will see “UpdateArcEndpoint” and “GetTeleportDestination”.
  5. Open each and you will find how that “Teleport Rotation” value is being used.

Hope this helps and check out the Twitch today for the answer to #3!

  • J-Small