Skip to content

This is a Unreal Engine 4 template for VR Headsets with motion controllers. It features dynamic hands, touch screens, grabbable objects, and locomotion.

Notifications You must be signed in to change notification settings

bradgrantham-lunarg/UE4-VRHands-Template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

UE4-VRHands-Template

UE4 4.25, C++ template, Oculus supported unless modified, can support other headsets if OpenXR plugin works and is enabled.

OpenXR production ready is a card for future release on the UE4 Roadmap

A newer more complete starter version without the objects is here.

This is a Unreal Engine 4 template for VR Headsets with motion controllers. It features dynamic hands, touch screens, grabbable objects, and locomotion.

The template supports UE4 version 4.25. because the motion controller keys were depreciated for OpenXR support, I had to convert this into a C++ template in order to access the Oculus Motion controller EKey structs so that the hands can be switched. This only supports Oculus unless you modify it yourself or the OpenXR plugin starts working and emulates the mapping to other headsets.

If you are using the UE4 launcher, put the template into UE4 by putting the FP_VRHands folder into: C:\Program Files\Epic Games\UE_4.25\Templates

See Creating Templates for help setting up.

When making a new map with VRHands functionality, use the VRPawn as a pawn, place a nav mesh to allow the pawn to move. For the grabbable object highlight, place a post process volume with the Highlight material in the Post Process Materials array under Rendering Features category and make sure you have the correct rendering settings in the project settings (forward shading, vertex fogging for opaque, custom depth-stencil pass set to enabled with stencil). If you want a cursor above the grabbable object then just wire up the cursor in the highlight function of the Grabbable component.

For grabbable objects, create an actor with a Grabbable component and static mesh then set the grab kind for the Grabbable component at event begin play. See the CubeBP for example.

This has the BP from this Arm Swinger Style Movement Tutorial for Unreal 4 video but is not wired up.

It also uses this Ue4 Tutorial - Moving an Object along a path using a Spline Track video.

For the dynamic hands, grabbable objects and highlighting is from UVRF project template.

Also, this uses open iconic for the template graphic.

Touch Screen interaction was figured out from this answer by AllJonasNeeds at UnrealEngine.com.

The incremental move (forward, back, strafe right, strafe left, turn right, turn left) by throwing a ball a meter away onto the nav mesh was my work.

There is a bug that I couldn't fix, it happens when the player does a spline move after a teleport--what happens is any CheckLineCollision function for the spline move will hit a Model Component for unknown reasons and then you would have to just use the trace end which makes it seems pointless but it works as I couldn't spline move across the box brush table.

About

This is a Unreal Engine 4 template for VR Headsets with motion controllers. It features dynamic hands, touch screens, grabbable objects, and locomotion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 83.3%
  • C# 15.7%
  • C 1.0%