This project contains reusable components based on the most robust hand tracking mechanics from First Steps with Hand Tracking and Tiny Castles.
You can try the showcase for yourself on Quest here.
This codebase is available both as a reference and as a template for multiplayer VR games. All code and assets are under the license found here unless otherwise specified.
See the CONTRIBUTING file for how to help out.
First, ensure you have Git LFS installed by running this command:
git lfs install
Then, clone this repo using the "Code" button above, or this command:
git clone https://github.com/oculus-samples/Unreal-HandGameplay.git
Finally, launch the project in the Unreal Editor using one of the following options.
The easiest way to get started is to use the prebuilt Unreal Engine from the Epic Games Launcher. However, the Hand Movement Filtering will not be functional without using the Oculus fork below.
- Install the Epic Games Launcher
- In the launcher, install Unreal Engine 4.27.2 or later
- Launch the Unreal Editor
- Click "More"
- Click "Browse" and select
HandGameplay.uproject
The Oculus Unreal fork will give you the most up to date integration of Oculus features, including support for Hand Movement Filtering. However, you must build the editor from its source.
- Get access to the Unreal source code
- Clone the 4.27 branch of the Oculus fork
- Install Visual Studio
- Open a command prompt in the root of the Unreal, then run this command:
.\GenerateProjectFiles.bat -Game HandGameplay -Engine <full path to Unreal-HandGameplay directory>\HandGameplay.uproject
- Open the
HandGameplay.sln
file that has been generated in theUnreal-HandGameplay
directory. - Set
HandGameplay
as the start-up project andDevelopment Editor
as the configuration. - Hit
F5
to build and debug the project (and the engine).
To integrate these features into your own project, install the OculusHandTools plugin into your project. The easiest way to do so is to download the latest release of OculusHandTools.zip
and extract it into your project's Plugins
folder.
You can find a detailed breakdown of how the mechanics are implemented here. In addition to the featured mechanics, the OculusHandTools plugin has several useful C++ modules:
- HandInput
- HandPoseRecognition
- OculusHandTrackingFilter
- OculusInteractable
- OculusThrowAssist
- OculusUtils
Teleportation | A simple movement mechanic using pose recognition from the Hand Pose Showcase. | |
Grabbing | A system for recognizing natural grab gestures, attaching the object to your hand, and overriding the pose of your rendered hand for visual feedback. | |
Throwing | This component uses the hand’s historical data to determine the velocity of the thrown object. | |
Button Pushing | A reliable digital interaction. (Get it, digital? It’s on or off, but also your pointer finger is a digit. I’ll let myself out…) | |
Punching | Punching is a fulfilling interaction with your hands, despite the fast movement being a cause of tracking loss. | |
Hand Movement Filtering | Stabilizes the hand and finger movement while tracking is low quality or lost. This significantly improves the feel of using your hands, particularly in poor tracking situations like while punching. You can read more about the implementation of this component here. | |
Two-handed Aiming | Aiming is a reliable, useful, and fulfilling hand interaction when done with both hands. | |
Example Hands for Tutorials | Effectively illustrate to users the poses your app expects. |