Download

[FREE] VR Content Examples

Hi @Patrick_000 yes it’s just that the project is compressed you can use WinRar to unzip it

THANK YOU for offering this to the community, @DownToCode ! This is awesome! I’ve just been trying to integrate the Drawer into my existing project. I’m using the default VR template with motioncontroller Pawn. I’ve gotten the drawer to open, but the hand doesn’t let go. I see that you have a note that the “Pickup” and “Drop” handle only get called on pickup handle. Is this the cause for my troubles? Is there a reason for this functionality the way you have it set up, and can I change something in my UE4 VR template-based project to make it work? Thanks!

I’m also trying to get the velocity of the drawer. Do you know how I could do that?

Edit: The same thing happens with the Door blueprint as well. So maybe it’s something to do with me using the default VR Template “BP_MotionController” and “MotionControllerPawn” instead of using yours? Maybe how it’s calling on the motion controller variables? Not sure, as I’m no expert on all this. I look forward to your help with this!

Hi @MechanicWhispers I’m really happy to see more and more people are finding this useful. Regarding the drawer what the comment you mention means is that the drawer only gets grabbed when you overlap with the handle instead of the whole drawer, so that’s not why you can’t let go.

The reason for the bug is that if you go in the motion controller VR Template actor the release function checks if the attached actor is valid before releasing but also checks to see if the root component attach parent is the motion controller (this is done to avoid conflicts between the two hands release actions). The problem is that only works with the default cube since it’s a static mesh actor and the root component is the object you attach to the hand, in the drawer example however we don’t attach anything to the hand (we just track its location) so when you release that check fails and returns false.

If you look at my implementation of the release function you can see that I just check if the attached actor is valid which means that in the drawer example you can grab with the left hand then with the right, release the left-hand grip and the right hand will also release the object.

One way to solve that is to pass the hand enumeration (EControllerHand type) value into the pickup event then every time you pick up the drawer you update a hand variable inside the drawer blueprint (need to create one) so that the drawer knows which hand picked it up. You can then add a new event to the pick-up interface called CanPickupObject? which could also accept a hand variable and return a bool. You can then use this event instead of the check I highlighted in the picture aboe to know if you can release that object. The CanPickupObject? function has to obviously be implemented in the drawer actor so that it returns true if it’s picked up and the hand variable is the same as the one stored or false if the hand variable is different.

Thank you, @DownToCode ! That makes a bit more sense now. What I actually ended up doing, was replacing what you circled in red with a “Does Implement Interface” node and set it to “Pickup Actor Interface”. That way, it works with both your drawer/door handles, as well as the default VR Template BP_PickupCube. Although, now, I’m not able to pass the cube from one hand to the other without the first hand dropping it. Need to troubleshoot that now on my end. Maybe I’ll try to do what you say above, when I have a moment more.

Hey @DownToCode ,
thank you very much for your support! It’s awesome. I currently work on my doctorade and get some stuff in UE4 done. I currently have the problem, that when I import your ForceGrabPickupPawn I can’t compile it. When I open your example projects, it works without problems. Just after the migration into my own project, this error occurs.

That looks to me like you need to add/define Action Mappings to your own Project Settings for “LeftGrab” and “RightGrab”

@Proczy @MechanicWhispers is absolutely right. Those are action mappings that get defined in the project setting inputs. They will be recognized in the VRContentExamples project because I defined them. However if you migrate anything to another project you will have to redefine the action mappings and assign them to the right buttons in the project settings inputs of your project.

Hi @DownToCode ! I’ve been playing with your “Door” example, and I am trying to push what it can do. I would like to make double doors, so that when you pull the handle on one, the other opens to the same angle. And vice versa. I’ve tried implementing a blueprint interface to get the doors to talk to each other and share the “door angle”. But that wasn’t working. Then I just used custom events to try the same thing. This is working a bit better, but the doors are still not moving correctly. Any idea how this could be done?

Edit: Just to be clear by “double doors”, I mean dropping in your door blueprint, then making a copy, and either scaling it in the negative Y, or rotating it 180 degrees. I’ve tried both ways, and rotating 180 degrees gave better results for the interaction. One is set to min angle:0, max angle 130. Then the other is set to min angle:-130, max angle: 0.

Hi @MechanicWhispers one thing about the VRContentExamples examples is that they are very basic and the bare minimum to get something to work. So they are really a place to get you started. What you are after is totally doable but will most likely need some changes to the door logic to handle mimicking one door rotation to the other and viceversa.

Your thinking sounds good to me, you would probably make one door angle drive the other door, the only issue is understanding how to the angle works for the other door since it’s flipped. I assume you wouldn’t directly use it but would have to make some calculations before applying it.

Anyway it’s something I will have to try myself to give you an answer. I’ll get back to you when I gave it a go.

Thanks for sharing this.

Newbie question, but I opened DoorMap and hit Play in VR Preview, but my Oculus Rift controllers can’t grab the door handle.

What should I do to fix this?

Hi @Sky_Shrimp really glad to see more and more people taking a look at this :cool:

The very first thing I can think about is an Unreal Engine bug that keeps bothering me on a daily basis. Once you hit VR Preview before you wear your headset make sure that the VR preview window is on top of the Unreal Engine window and that it’s focused. If you can see the mouse cursor anywhere on the screen then it’s not focused, make sure to click on the VR preview window anywhere so that it gets focused. No inputs get registered unless you have the VR preview focused. For some dumb reason and totally random when I hit play sometimes the VR preview gets sent in the background.

If it’s not that, make sure that the LeftGrab and RightGrab events in the door VRPawn are called when you actually press the grip button on your controllers. If they don’t get called go to the Project Settings > Inputs and make sure that both action mappings are assigned to the Oculus Touch (L/R) Grip button events.

Thanks. I checked those things on your advice. The action mappings seem to be correctly assigned.

Is anyone else able to open the door in the VR Content Examples with an Oculus Rift CV1 or is it just me? I can’t grab the bow or open the draws either.

I wondered if maybe something in Epic’s VR template was missing, so I tried to copy paste the Door folder to the UE4 VR motioncontrollermap, but got an unknown extension: uasset fail for all the door assets.

I’m using UE4 4.24.3 and just trying to sample and study your free download DownToCode.

It doesn’t help that I have no blueprint knowledge. Curious if anyone else has got it to work with Oculus Rift.

.

Great project! There are few VR projects that are this vast and yet as simple as it can get.

I´m having the same problem as Sky_Shrimp using Vive in 4.24 and Thought this was happening only on vive. None of the commands triggers the actions. I have used a Print String to check the input and it works fine. I have now to check the connections closer to see if I can see anything strange, but it´s odd that is not working for any of the maps.

How did you get the door in the VR template project? You shouldn’t just copy files across as any dependencies needed or conversion necessary won’t be checked. You will have to right click on the door blueprint and go to asset actions and then migrate. That will migrate all its needed for the door example to work.

To be fair I stopped using the oculus rift time ago so I never tested that project with it, however if the right buttons are assigned to the action mappings it should work. The buttons you use for the quest, rift s and rift are the same as far as I know.

So you if run your VR preview while looking at the VR pawn blueprint and having the window focused if you press the grip does the LeftGrip and RightGrip event fire? Are you testing all this in the VRContentExamples project itself?

If you go to the project folder inside the config folder do you see a JSON file and a folder called SteamVRBindings? If you do delete both the file and the folder. Not the ini files but the json file with the SteamVRBindings folder.

That is exactly what I aimed for, a full list of common VR interactions that are stripped away of any unnecessary fluff.

I’m a bit confused, do the events LeftGrip and RightGrip fire or they don’t?

In your case though since you are using a Vive the SteamVRInput could really be the issue. It will be enabled by default(it’s now part of unreal), you will have to make sure that the action manifest gets created before you can get your inputs working. If you don’t know what the plugin is and what it does look it up to see how to get it to work. I need to make a tutorial on this anyway since I would expect a lot of people to struggle with this. It’s the least intuitive plugin I worked with so far.

The events LeftGrip and RightGrip fire a Print String if I use it to debug, so the inputs are correct and working. But they won´t fire the actions. Nothing happens to the door, drawer, bow and so on. I know it´s hard for you to guess what might be causing this, but I just wanted to let you know in case this is happening to other Vive users. I´ll try to see if can find what´s going on. Thanks!

@Baddini thanks definitely appreciate you reporting that. It sounds really weird that the events fire but then nothing actually happens. Can you try to download the project again using the link, I just updated today. I have the suspicion that something may be broken with the copy you are using since I did introduce some changes to parts of the blueprints.

Let me know once you downloaded it if it works with the latest version.

It was definitely it! I downloaded the new version and it´s working right way. Thank you for the much valuable project!

Cool that’s great then I bet the same was happening to @Sky_Shrimp who should also redownload the project.

I just downloaded V3. It works fine with the Oculus Rift.

@Sky_Shrimp yh then it was me messing up the interactions :rolleyes: glad it works now