Meta Mixed Reality Template
Learn how to get started with MR Template as a starting point for your MR project on Meta Quest.
The MR Template is designed to be a starting point for your Mixed Reality projects on Meta Quest in Unreal Engine. It can act both as a starting point for exploration with Mixed Reality and other Presence Platform features, or the starting point for a complete project. It includes encapsulated logic for Passthrough, Scene loading, common input actions, such as grabbing and hands support.
How to download and get started
- Meta Quest 2
- Meta Quest Pro
- Meta Quest 3
Pawn, Game Mode and Player Start
The following objects determine the rules of the MR Template experience and how it is set up.
| UE Object | Name of Object in the template | Location | Description |
|---|
Pawn | MRPawn | Content > Blueprints > Core | In Unreal Engine, a Pawn is the physical representation of the user and defines how the user interacts with the virtual world. In the MR Template, the Pawn contains the logic for input events from the motion controllers and hands, as well as Passthrough Layer. |
Game Mode | MRGameMode | Content > Blueprints > Core | The Game Mode object defines the rules of the experience, such as which Pawn object to use. The Game Mode is set in Project Settings, in the Maps & Modes section. |
Player Start | Player Start | World Outliner | The Player Start Actor defines where the Pawn is spawned in the virtual world. For MR experiences, the Player Start’s origin is the tracking origin in the virtual world. Since the MR Template is designed for standing experiences in MR, the Player Start is located at floor level. |
The MR Template demonstrates several methods for picking up objects and attaching them to your hands.
To grab an object in the level:
- Reach out to a grabbable object (virtual plant), then press and hold the Grip button on your Motion Controller.
- This creates a Sphere Trace around the position of your Motion Controller’s GripLocation. If there’s an Actor with a GrabComponent in that sphere, it becomes attached to the hand that pressed the Grip button.
- Release the Grip button on the same Motion Controller to detach the object from your hand.
To enable grabbing on an actor, add the GrabComponent blueprint to the actor and select the Grab Type in the Details window. On BeginPlay, the collision profile of the component’s parent is set to PhysicsActor, which is the trace channel used for the Sphere Trace in MRPawn.
You can open the GrabComponent Blueprint class to see how the grab system is implemented in the MR template.
The MR Template demonstrates how to achieve the effect of windows to the VR world through physical room windows using the Stencil buffer technique.
Check mVRWorldMaterial and mTransparentWindow materials to see implementation details.
The AI agent character that can navigate around the room is spawned. It makes use of the NavMeshBoundsVolume.
Spawning Virtual objects on anchor label
Virtual plant is spawned on a table in the room if there is any or on the floor if no table is presented in the room.
To see implementation details check SpawnMRElements in the Level blueprint.