The Pawn Blueprint

The Pawn Blueprint used in MotionControllerMap is MotionControllerPawn. This Blueprint represents the player in the level. Double-click it to open the Blueprint Editor.

The following screenshot shows the Components panel of the MotionControllerPawn Blueprint. Below DefaultSceneRoot, there is a Scene Component named VROrigin. The VROrigin Scene Component represents the tracking origin of the HMD and is used as a reference point to Camera and the Motion Controllers. Some HMDs use the tracking origin at floor level, while others use it at eye level:

There is a Motion Controller Component that could be added as a child Component of VROrigin. However, the VR template created a Blueprint named BP_MotionController that contains the Motion Controller Component and possesses other features.

MotionControllerPawn has two variables of the BP_MotionController type, which reference the left and right Motion Controllers. The following screenshot shows these variables:

The instances of BP_MotionController are spawned in Event BeginPlay of MotionControllerPawn. The next screenshot shows the actions used to spawn Left Controller and attach it to the VROrigin component:

MotionControllerPawn is also responsible for handling the controller input for grabbing objects and teleporting. These two Actions will be analyzed in their respective sections.

There are many Blueprint Functions related to HMD. They are grouped in the Input | Head Mounted Display category, as shown in the following screenshot:

MotionControllerPawn works together with the BP_MotionController Blueprint to allow the user to interact with the world using VR. We will now see how the BP_MotionController Blueprint is implemented. 

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

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