VR Game Template


**I have stopped supporting this template for the time being, the thread and post will remain for posterity’s sake.
For the future of the template and my work in the VR community see this post **

for my tutorial series this thread:

------Original post follows------

There was this recent post on the Oculus Sub Reddit Reddit Link Asking for a Rift game template, I thought I might build one up, it’s focused for beginners who haven’t done much with UE4 and therefore has the blueprints that I generally use with most rift projects. Also from suggestions from this forum post I created a separate Space Shooter Template this post will be split up into two sections the first being the first person template and the second being the space shooter.

I have now put both projects on GitHub which allows any edits you do to be easily shared with the community, I will still update this post with the new features and downloads however.

------First Person Template------


-Latest- GitHub V0.4.1

Google Drive V0.3
Google Drive V0.2
Google Drive V0.1

Once Downloaded Unzip the package into your templates directory, generally in ‘C:\Program Files\Unreal Engine[Version]\Templates’
After this when you launch the engine you should see the new ‘rift first person’ template

-In Game changing of Important settings to the Rift, Screen Percentage and Distortion Scale
-Look based interaction for blueprints(currently Highlighting, toggling visibility and time based interactions). Here’s a Video of how I go about setting up the first two.
-Head Rotation Blend Spaces controlled by the HMD rotation
-Semi-modular character so you can’t see the inside of the head in game
-Rift optimised global post processing
-Character rotation based from head look and positional tracking body IK
-VR Comfort Mode (for more info visit CloudHeadGames)
-Decoupled View, as well as ‘Tank Style’ looking when not moving
-A context menu for changing locomotion, HMD settings and scalability settings

Edit 25/06/14 (V0.2)Added Locomotion options and often used movement input mechanics
Edit 28/06/14 (V0.3)Added A context menu toggled by ‘Enter’ this allows changing of scalability settings and movement mechanics, also added time based interaction for telling how long you’ve looked at an interactive object.
Edit 31/08/14 (v0.4)DK2 support
All Video Links:
Head Offsets
Highlighting and look interaction
VR Controller
Locomotion Options
Context Menu
Time Based Interaction
DK2 Update

------Space Shooter Template------


-Latest- GitHub V0.2

Google Drive V0.1

Once Downloaded Unzip the package into your templates directory, generally in ‘C:\Program Files\Unreal Engine[Version]\Templates’

-Full 6DOF pawn
-IK based hand interaction with the steering wheel
-Two weapons, one straight fire laser rockets the other target seeking missile
-3D menu for scalability settings
-3D HUD with time based interactions for triggering missiles and Health Bar and Energy Bar

DK2 Update

Edit 6/07/14 (v0.1) Added the space shooter template
Edit 31/08/14 (v0.1) DK2 update

I’ll continue to update these templates for free but if you feel like they have helped you enough feel free to

Feel free to add any suggestions for updates to the template, I want this to be very much a community based project so don’t hesitate to tell me what I’m doing wrong or could do better. As well feel free to make changes and submit them here, thanks Mitch.

This is awesome!

One request, if at all possible, would be to have an example of how to make the full-body pawn use a yaw rotation setup where you can look left/right 90 degrees without rotating the pawn, but when you hit the limit, it starts rotating.

I tried to get that working on my end without luck, and ended up just setting the UseControllerRotationYaw variable so the pawn will follow the camera, but I’d really really like it to be set up the other way.

Here’s a thread about the issue, with the blueprint for limiting camera rotation:

Fantastic work! I’ve added a refrence to your template on the Oculus Rift wiki page for Unreal Engine. Please feel free to add any details or information to that section if you like as I’m sure a lot of devs checking through the wiki will find it useful.

n00854180t Just so I’m clear, you want decoupled viewing but when you hit 90 degrees left and right, just the character mesh rotates or the entire character with the camera? Also would the mouse left and right turn the character mesh or just the camera?

Yep, decoupled viewing, with it rotating the character (and camera) when you hit the 90deg limit left/right (an option to make it lerp-rotate the pawn to the cam when hitting the limit, instead of rotating both cam and pawn, would also be amazing). Mouse left/right would just turn the camera until it hits the limit.

You’re the man, thanks so much for this template :smiley:

Great stuff, thanks for sharing :slight_smile:

Thank you so much, this is awesome! :cool:

Just want to thak you, I’m waiting for my dk2 to mess with UE4 an VR, your work will help me a lot and save so munch time with my little projecs

Here you are, just download V0.2



That is awesome!

Wishlist (thinking towards DK2 a bit):

Techniques for dealing with clipping issues related to positional tracking.

  • Mode for blanking the camera (fade to black) when it penetrates something.

  • Mode for pushing the character’s body out away from the wall.

This template will easily secure UE4 as the engine of choice for Rift dev, if you ask me.

Thanks and yeah sure, fade to black is pretty simple (Actually I use it in a couple of demo’s already)
I will definitely be updating the template as soon as my DK2 arrives (Come on July :D)

This is awesome, can’t wait to try this out later!

Great work mitchemmc! Definitely going to give this a shot when I get some time.

Awesome template! Been looking for something like this.

I do have a problem that I can’t seem to go fullscreen when testing the standalone game, it just crashes after my screens flicker a few times (although the process keeps running in the background and I have to kill it manually through task manager). Though it might not be related to the project.

I’d be down to add the second mode myself when my DK2 arrives, though I have a late order, so that’s not till August some time.

To start I guess I’ll just make it do the obvious thing and push the whole character back. How are you detecting interpenetrations for the black-out mode? It seems like you’d want the same thing for the other mode, but to push the character before they see the clipping.

Edit: I guess I can just line trace directly forward from the cam pos, that should work. Probably better.

This is awesome!! Thank you for working on this. Looking forward to an update for dev kit 2 as I don’t have a rift yet but will in July :). If you don’t mind what are your PC specs? Looks like you are getting 60 FPS at a decent resolution.

I am very happy with this. :slight_smile: Thank you!