Skip to content

oculus-samples/Unreal-HandGameplay

Hand Gameplay Showcase

This project offers reusable components built on the robust hand tracking mechanics from First Steps with Hand Tracking and Tiny Castles.

Try the showcase yourself on the Horizon Store.

Build Instructions

Download the Project

First, install Git LFS by running:

git lfs install

Next, clone this repository using the "Code" button above or run:

git clone https://github.com/oculus-samples/Unreal-HandGameplay.git

Finally, open the project in Unreal Editor using one of the following methods.

Epic Games Launcher

The easiest way to start is with the prebuilt Unreal Engine from the Epic Games Launcher. Note that the Hand Movement Filtering will not work without the Oculus fork described below.

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

Oculus Unreal Fork

The Oculus Unreal fork provides the latest Oculus feature integration but requires building the editor from source.

  1. Get access to the Unreal source code.
  2. Clone the oculus-5.6 branch of the Oculus fork.
  3. Install Visual Studio.
  4. Open a command prompt in the Unreal root directory and run:
.\GenerateProjectFiles.bat -Game HandGameplay -Engine <full path to Unreal-HandGameplay directory>\HandGameplay.uproject
  1. Open the generated HandGameplay.sln file in the Unreal-HandGameplay directory.
  2. Set HandGameplay as the start-up project and Development Editor as the configuration.
  3. Press F5 to build and debug the project and engine.

Use as Plugin

To add these features to your project, install the OculusHandTools plugin. Download the latest release of OculusHandTools.zip and extract it into your project's Plugins folder.

For a detailed explanation of the mechanics, see here. The OculusHandTools plugin also includes several useful C++ modules:

Features

Feature Image Description
Teleportation Simple movement using pose recognition from the Hand Pose Showcase.
Grabbing Recognizes natural grab gestures, attaches objects to your hand, and overrides hand pose for visual feedback.
Throwing   Uses hand history data to calculate the velocity of thrown objects.
Button Pushing Reliable digital interaction (on/off). (Bonus: your pointer finger is a digit!)
Punching A satisfying hand interaction, despite fast movement sometimes causing tracking loss.
Hand Movement Filtering   Stabilizes hand and finger movement during low-quality or lost tracking, improving feel especially during punching. More details here.
Two-handed Aiming Reliable and fulfilling hand interaction using both hands.
Example Hands for Tutorials   Illustrates the poses your app expects from users.

License

This codebase serves as a reference and template for multiplayer VR games. All code and assets follow the license found here, unless otherwise noted.

Contribution

See the CONTRIBUTING file for contribution guidelines.

Updates

20 December 2023 Update

We updated the project to UE5.3.

March 2025 Update

We updated the project to use OpenXR from Epic with meta vendor extensions. Please note, you can still use the OVRPlugin, but you'll need to update the Grab Poses on:

  • Content/HandGameplay/Probs/Blocks/InteractableBrick
  • Content/HandGameplay/Probs/RingWeapon/InteractableArtifactHandle

Example for InteractableBrick:

  • Change relative Hand Transform left to: LOC X1.623 Y12.178 Z8.067 ROT W0.160 X0.189 Y-0.832 Z-0.497
  • Change relative Hand Transform right to: LOC X5.690 Y-10.448 Z-8.640 ROT W0.840 X0.534 Y0.064 Z0.068

Example for InteractableArtifactHandle:

  • Change relative Hand Transform left to: LOC X1.094 Y6.294 Z11.635 ROT W0.101 X-0.548 Y-0.830 Z-0.009
  • Change relative Hand Transform right to: LOC X-0.519 Y-6.451 Z-12.047 ROT W0.859 X0.053 Y0.058 Z-0.506

Best way to get new HandTransforms:

  • Open HansCharacterHandsState from OculusHandTools/Content/Hands/
  • Reconnect the Blueprint-flow-nodes
  • This will output the location of your hand when grabbing an object in the correct format for copy and paste.

04 December 2025 Update

We fixed an issue related to objects jittering when grabbed. We updated the project to UE5.6. + Meta SDK v81

About

Oculus showcase of hand tracking based interactions in Unreal.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 10