Announcement

Collapse
No announcement yet.

How to make use of the Proximity Sensor in Blueprints?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [OCULUS] How to make use of the Proximity Sensor in Blueprints?

    Does anyone know how to make use of the proximity sensor on the Rift using Blueprints? I'd like to be able to have my experience play/pause/restart when the headset is taken off and on. I can't seem to figure out how to do this. Some help would be greatly appreciated!

    #2
    Bumping this as I see this to be a pretty important issue. Is there really no way to implement this? When I currently take the headset off during gameplay, the scene is no longer rendered, but I can still hear audio and all of my events are still ticking.
    Last edited by NCMcClure; 08-08-2016, 11:40 AM.

    Comment


      #3
      Bumping this yet again. I don't understand how most people aren't asking about this feature, it seems to be a pretty crucial one for creating a VR game and it's not documented anywhere whatsoever.

      Comment


        #4
        Bumping again.

        Comment


          #5
          I remember the good old time when you had an answer from one of the Unreal dev guys in less than an hour... but thats when we had to pay every month for UE4

          Comment


            #6
            Yeah, the good old days ... It'd be really nice if someone would spread their knowledge about the proximity sensor. I think it's crazy that there wouldn't be some blueprint node for a hardware feature as simple as this. This is absolutely essential to my project as it will be demoed in public all day every day and I can't be there to restart the experience every 2 minutes. Come on Unreal Devs, throw me a bone here!

            Comment


              #7
              Its not possible atm. Also, after working with the vive's proximity sensor (in code), its not that great and half works (basically there is a weird delay). Hopefully valve can iron the issues out and make it more consistent. But either way, I've entered the new feature request as UE-34593
              Twitter - @TheKRushin

              Feel free to ask questions and come learn to be an #UnrealDev

              How to report a Bug

              Comment


                #8
                Originally posted by KRushin View Post
                Its not possible atm. Also, after working with the vive's proximity sensor (in code), its not that great and half works (basically there is a weird delay). Hopefully valve can iron the issues out and make it more consistent. But either way, I've entered the new feature request as UE-34593
                Thanks for the reply and the feature request KRushin, it's much appreciated! I was feeling pretty alone in this situation for a little while there. If there's not a way in blueprints, do you know of a way in code?

                Comment


                  #9
                  Originally posted by KRushin View Post
                  Its not possible atm. Also, after working with the vive's proximity sensor (in code), its not that great and half works (basically there is a weird delay). Hopefully valve can iron the issues out and make it more consistent. But either way, I've entered the new feature request as UE-34593
                  Originally posted by NCMcClure View Post
                  Thanks for the reply and the feature request KRushin, it's much appreciated! I was feeling pretty alone in this situation for a little while there. If there's not a way in blueprints, do you know of a way in code?
                  Ok, I've done a preliminary code up of getting access to some of the proximity sensor stuff and also detecting when the user opens oculus home, I added it to the VR Notifications component as 4 new delegates that you can use to detect these things:
                  Click image for larger version

Name:	NewNRNotifications.jpg
Views:	1
Size:	168.4 KB
ID:	1113881

                  They correspond to the guidelines on the Oculus developer docs found here

                  [MENTION=157481]NCMcClure[/MENTION] If you want to integrate these changes into you own 4.12 branch they can be found on my Github

                  I originally tried to get all this working just as a plugin but the Oculus Plugin doesn't allow you to get access to the oculus service to check for the proximity sensor outside of itself, so that was a no go.

                  Currently I've only implemented it for the Rift but the Vive will be easy,

                  and also [MENTION=4978]KRushin[/MENTION] what your seeing with the vive's proximity is actually by design (see here)

                  Anyway hopefully if epic finds this useful they will accept it as a PR so others don't have patch it in themselves

                  Thanks,
                  Mitch

                  Edit: It seems that the vive doesn't even use the proximity sensor yet, the event that is supposed to be tied to the proximity sensor seems to just be triggered when the headset is moved after being stationary (like sitting on a desk)
                  Last edited by mitchemmc; 08-18-2016, 11:55 PM.
                  UE4 VR Cookbook
                  Mitch's VR Lab tutorial series
                  VR Content Examples

                  Comment


                    #10
                    Thank you, Mitch! You're a project (life?) saver!

                    Comment


                      #11
                      Hi all!

                      Thanks for this thread! I have also tried to find an answer to this. I actually posted a question similar here:
                      https://forums.unrealengine.com/show...+notifications

                      So is this working for you guys?
                      In UE4 v.4.14 I found the similar node "HMD Removed From Head Delegate" and vice verse. But I haven't been able to get it to work. The only thing that happens when proximity sense no head is turning Oculus and monitor into black. My ideá was to have the monitor to i.e. add a 2D widget to screen when that happens.
                      Do you think "IsHMDEnabled" could work?

                      Thank you guys!

                      Comment


                        #12
                        I made the one in HTCVive to work, but never used the one on Rift. It was having a great precision and made little changes, if you want me to post here I can.

                        Kind regards,

                        Comment


                          #13
                          Hi Pekayatt,

                          If you're able to give some more input here on that it would be great!

                          Kind regards,

                          Comment


                            #14
                            Originally posted by SBK3d View Post
                            Hi Pekayatt,

                            If you're able to give some more input here on that it would be great!

                            Kind regards,
                            The solution is to create some calls on the case of line 787 of SteamVRHMD.cpp (case vr::VREvent_TrackedDeviceUserInteractionEnded at least was that on 4.13

                            You must follow the delegates as in FCoreDelegates::ApplicationHasEnteredForegroundDelegate.Broadcast();, I have created a Broadcast to a VRNotificationComponent.

                            Just realize that I lost the modifications on a old version (4.12), so I will need to build it again hahaha.

                            If you have too much trouble please let me know.

                            Kind regards,

                            Comment


                              #15
                              Originally posted by SBK3d View Post
                              Hi all!

                              Thanks for this thread! I have also tried to find an answer to this. I actually posted a question similar here:
                              https://forums.unrealengine.com/show...+notifications

                              So is this working for you guys?
                              In UE4 v.4.14 I found the similar node "HMD Removed From Head Delegate" and vice verse. But I haven't been able to get it to work. The only thing that happens when proximity sense no head is turning Oculus and monitor into black. My ideá was to have the monitor to i.e. add a 2D widget to screen when that happens.
                              Do you think "IsHMDEnabled" could work?

                              Thank you guys!
                              In my testing (and digging through the source) Epic added those delegates to the VR Notification component in 4.14 but never implemented them anywhere! Which is a real bummer, and makes me a little frustrated. But anywho I was thinking of fixing it and making a pull request (although its a pretty simple thing to fix and Epic has a pretty bad track record for accepting pull requests...)

                              Originally posted by pekayatt View Post
                              The solution is to create some calls on the case of line 787 of SteamVRHMD.cpp (case vr::VREvent_TrackedDeviceUserInteractionEnded at least was that on 4.13

                              You must follow the delegates as in FCoreDelegates::ApplicationHasEnteredForegroundDelegate.Broadcast();, I have created a Broadcast to a VRNotificationComponent.

                              Just realize that I lost the modifications on a old version (4.12), so I will need to build it again hahaha.

                              If you have too much trouble please let me know.

                              Kind regards,
                              In my testing SteamVR its self does not use the Vive proximity sensor, and unless this has been updated (which is quite possibly true) this would still run into the same problem as above (since my code is using TrackedDeviceUserInteractionEnded as well)
                              UE4 VR Cookbook
                              Mitch's VR Lab tutorial series
                              VR Content Examples

                              Comment

                              Working...
                              X