/Unreal-HandGameplay

Oculus showcase of hand tracking based interactions in Unreal.

Primary LanguageC++MIT LicenseMIT

Hand Gameplay Showcase

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.

How to Use

Load the project

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.

Epic Games Launcher

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.

  1. Install the Epic Games Launcher
  2. In the launcher, install Unreal Engine 4.27.2 or later
  3. Launch the Unreal Editor
  4. Click "More"
  5. Click "Browse" and select HandGameplay.uproject

Oculus Unreal fork

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.

  1. Get access to the Unreal source code
  2. Clone the 4.27 branch of the Oculus fork
  3. Install Visual Studio
  4. 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
  1. Open the HandGameplay.sln file that has been generated in the Unreal-HandGameplay directory.
  2. Set HandGameplay as the start-up project and Development Editor as the configuration.
  3. Hit F5 to build and debug the project (and the engine).

Use as plugin

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:

Features

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.