The Motion Controller Blueprint

Motion Controllers are implemented by the BP_MotionController Blueprint. Double-click it to open the Blueprint Editor.

Click on the Viewport tab to see a visual representation of the Blueprint, as shown in the following screenshot. The Motion Controller is represented by a hand Skeletal Mesh and has other visual Components that are used in the teleport:

The next screenshot shows the Components panel of BP_MotionController:

Brief descriptions of the Components are as follows:

  • Scene: The root Component.
  • MotionController: The Motion Controller Component that tracks a Motion Controller device. When you move the Motion Controller device, the data of this movement is sent to the Motion Controller Component.
  • HandMesh: A Skeletal Mesh Component of a hand.
  • ArcDirection: An arrow Component used to indicate the direction of the teleport.
  • ArcSpline: A Spline Component used to draw a curve representing the teleport movement.
  • GrabSphere: A Collision Component used to detect whether the Motion Controller is overlapping an Actor on the Level.
  • ArcEndPoint: A Static Mesh Component that stores the end location of ArcSpline.
  • TeleportCylinder: A Static Mesh Component used to visually represent the target of the teleport.
  • Ring: Another Static Mesh Component used to represent the target of the teleport visually.
  • Arrow: A Static Mesh Component that indicates the rotation of the teleport.
  • RoomScaleMesh: A Static Mesh Component visualized around the teleport target. It is only rendered if room-scale was successfully set up on the HMD.
  • SteamVRChaperone: A Component used to map the playable area.

The Events related to the Motion Controller buttons are grouped in the Input | Gamepad Events category. The following screenshot shows the Events of the left Motion Controller, which are identified by (L), and the same Events of the right Motion Controller, which are identified by (R):

The VR template created Input Mappings for the GrabLeft, GrabRight, TeleportLeft, and TeleportRight Actions. They were associated with Motion Controller buttons, as shown in the following screenshot. The Input Mappings can be accessed via the Edit | Project Settingsā€¦ Input menu:

Now that we've learned about how the MotionControllerPawn and
 
BP_MotionController Blueprints work, let's see how they are used to grab objects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset