VR interaction project (open source)

Hello world,

I’m learning VR so I decided to recreate in UE4 the basic VR interactions like one can see in Oculus Home or SteamVR Home. That includes simple teleport and turn in place using thumbstick (without pressing), outline for objects that can be grabbed, laser pointer interaction, etc.

I took the default UE4 VR project and started to add new features to it. It’s a work in progress, so not everything is implemented yet. So far I implemented the teleportation, outlines and started laser pointer interaction. You can see the result so far in the video below:

If you want to try, the project is available on github:

GitHub - inugames/basic-vr: Extending the default UE4 VR template with basic interactions like in Oculus/SteamVR Home. WIP.

It’s basically the default UE VR project template with some modifications. Modified parts are mostly in MotionControllerMap, MotionControllerPawn and BP_MotionController. Modified parts are all commented in orange color and prefixed with [BasicVR], so you can easily search for them.

I only have Oculus Touch, so I’m not sure which controls are better for the Vive.

I’ll post here when I add some more features, so press Subscribe button above if you are interested.

I hope you find the project useful!

Edit: unfortunately I discovered that my eyes are not very VR friendly, so I don’t doing anything VR anymore. But the project is opensource, so feel free to grab it and modify it as you wish!

2 Likes

Update: laser pointer

Laser pointer and the held object are stabilized using Dynamic Moving Average Rotation, which filters out the small shaking of the hand, so it’s more easy to grab small objects at a distance.

2 Likes

Very thanks!

Thank you for doing this project. I downloaded it and tried it out. It works great and is a great addition to the standard VR pawn.

I’ve been putting off learning how to implement Github and source control and wondered if I could add widget interaction and a VR specific video quality menu.

I created a fork and am giving it a go. Thanks again!

Hi there, I’m glad you like it!

I’m looking to make a menu too right now, and I started with pause menu with just two buttons “Resume” and “Exit”. I want to render the menu on top of everything and I want it to be world locked or tracker locked (not face locked), like pause menu in Robo Recall. I found 2 ways to make it and both have issues (at least with Oculus).

First solution is to show a Widget Component directly. To show it on top of the scene I use a Transulucent material with depth test disabled. This is how Robo Recall do it, and it works pretty well, BUT! If you have TAA and you use it when the game is paused, then you have very ugly visual artifacts. There is a thread about the problem , they just disable anti aliasing when the menu is shown. Also, Robo recall don’t have this problem because it uses MSAA and not TAA.

Solution Nr.2 is to use stereo layers, like in this tutorial. With stereo layers the menu is much sharper and there is no artifacts on pause,
BUT!! there is a problem too. With Oculus World/Tracker locked layers are always intersecting the world, if you face a wall in game your menu will be hidden behind it. And the face locked layer is always on top of the world, but it will move with your head, so the trick from the tutorial will not work.

What I finally did is to use face locked stereo layer and then recalculate its relative transform on every tick so it will work as world locked. It works, just if you move your head quickly it gets a little bit stuck sometimes, but not much.

I wish there was a better solution…

I still have to add widget interaction and then I will put it on github

2 Likes

Nice work!

Added pause menu, it’s shown when the menu button on the left controller is pressed.
I decided to use the same approach as Robo Recall, using Widget Component directly, so I switched the project to forward rendering/msaa too. But the stereo layer implementation is provided too. Unfortunately, I didn’t found yet how to show laser pointer on top of the face locked layer

Github updated

1 Like

Thank you !

Update: added collision audio component, so when the cubes fall on the ground or collide there is a sound.

Heavily inspired by Robo Recall :))
Sounds are mine, sorry for the quality, that’s the first time I’m doing audio.

Another little change, there is a C++ function called SetCameraMovableDuringPause, this function sets UWorld->bIsCameraMoveableWhenPaused to “true”. This helps with visual artifacts that appears on pause on umg menus if TAA is used.

1 Like

Collision based animated fingers experiment

1 Like

Thanks for sharing this… Just started exploring VR with my quest and this will help alot.

Same here, I got the Oculus Rift like 2 months ago, then bought the Quest too. Never used VR before. I wish I tried it sooner lol :)))

thanks for sharing this great work … it help me lo and can you add option of selecting objects with lasr and change the material using a menu … thanks

Hi, this project is awesome! Specially for beginners like me is a big start point in a project, so thank you so much!!! This movements were what i was searching to achieve, but i was unable because i’ve started now in this world (very hard and new for me), coming from Archviz.
Now i’m newly stuck in my project and i have to ask your help, if you can.
I’m trying to move a collection of paintings inside a museum room (for now i use your “pickup cubes”), so i have to pick them up, move away from me (your laser picking is perfect for this) and when they are touching the wall i’d like to leave them attached to this, free to remove them or move in other positions, to see various installments of the paintings.
The problem, if i’m not wrong, is that when i pick up an object the physics simulation is off and so the collisions with the static meshes of the walls, making therefore disappearing paintings behind the walls.
Instead i need that paintings hitting the wall can detech collisions whit it and dispose (turning) according to the wall, in parallel, and then leave them in that position, but turning physics on when i leave them from the wall, letting them falling down and bounce on the floor.
I’ve seen that is possible to grab object with Physics Handles, but i don’t know if it’s possible to take objects from far with the laser and move them along this in this way.
So i ask you some advice on the best solution for this, hoping that i was clear in this explanation and sorry for the lenght of this post,
Thank you for your attention!!!

Hi there, I’m really grateful for your work and providing it to everyones use! It is exactly what I was looking for in ages! Thanks again!

THANK YOU SO MUCH FOR THIS! So excellent and elegant. Just a quick question, i there a way to get it to work in 4.18? I’m mostly in 4.24 but I’d love to incorporate real hands in an old thing I did,. I have added the hands BP and to a beautiful set of HD Arms and incorporating it into a Full Body IK setup a well!

Thank you! I’d be happy to have implementation in 4.18 to any degree as long as the ‘pickup with no digital penetration’ (gross LOL) is working :slight_smile:

THANK YOU!

I have decided to pick up and fork your project and expand it :wink: Thanks for a great starting point!

anyone who would like to help/contribute or just look at it here it is: GitHub - JJcherrycode/basic-vr: Extending the default UE4 VR template with basic interactions like in

1 Like

S2

big thanks for this Sir! I have found the official vr templates so empty and lack of stuff, glad to have heroes here!

Thank you for sharing this! Keep up the good work.

@jjwisniewka Fantastic work! Thanks for picking up the torch :slight_smile:

Quick question: Is this blueprint-based? Ive been trying to create hand collision where hands dont intersect with static meshes but im having real trouble getting it right.