[Gear VR] Back button functionality is broken

Oculus suggests that I should use gearvr.HandleBackButton console cmd to define back button behavior. UE4 4.11pre8 doesn’t have such cmd :confused:

I followed this tutorial to the tee https://docs.unrealengine.com/latest/INT/Platforms/GearVR/GlobalMenu/index.html and on the device, if I do short press, I get “Do you want to exit to Oculus Home?”. If I press No, I go into Universal menu instead of my game o.O

If I do long press, I do not see progress indicator (I see it in the play mode on PC when pressing K key) and I go into Universal menu from which I can’t go back into the game.

Hi ,

I believe the unable to return to game is a known issue and related to this fix:

Also UE4.11 does support the command see Tim’s last comment here:

Cheers,

I see. So the fix isn’t in 4.11pre8.

As for cvar, when I type it in the cmd line, nothing comes up. That makes me think cvar isn’t in 4.11pre8 either :confused:

For now I am actually fine with the way short and long press work - I don’t have in-game menu, so the prompt about exiting or not on short press is fine. It’s the fact that I can’t go back into the game is what bothers me.

Btw, how do I get logcat logs?

Hello ,

I wanted to mention that is correct in that you will need to use that command (gearvr.handlebackbutton 0 ). I have tested this on my end using the “Execute console command” node in 4.11 preview 8. I hope that this information helps.

Make it a great day

So, I did that and still not working.

I added that cmd - with cmd set to 0, back button doesn’t work at all. With cmd set to 1 it works, but I am still getting exactly the same issue as when I didn’t have that cmd on eventBeginPlay.

Here is how it looks like in the level BP:

http://s27.postimg.org/gc0hkdtb7/ue4_gearvr_backbutton_cmd.png

Here is my BP for back button, taken straight from the Epic’s docs:
full image: http://s17.postimg.org/fozbnmwz1/ue4_gearvr_backbutton_BP.png

http://s11.postimg.org/h4e9lo5ep/ue4_gearvr_backbutton_BP.png

Interesting thing - the app doesn’t crash. If I use Back button and go into UM, and then into Oculus Home, I can simply remove phone from GVR, press that button to the left of phone’s Home button, select my app that is still running and I will be asked to put phone into GVR. Once I do that, I am back in the game.

P.S. If I press K in the Editor when playing, progress bar appears as I hold K key.

P.P.S. Here is my project: Google Drive: Sign-in

Is the issue I am experiencing related to this (or perhaps exactly the same as) [4.11.0] Preview 8 - Critical - GearVR build crashes after onPause - Programming & Scripting - Unreal Engine Forums ?

I looked over the report that was give on that post (the link provided in your last comment). It appears that your issue is slightly different. However, the issue you are experiencing is a known issue (UE-27992) and it has been reported in the link that was given by (I have provided the link below for reference) please feel free to check that thread for future updates on this issue.

Link: [GearVR] Back Button behavior no longer as expected in 4.11 P6 - XR Development - Epic Developer Community Forums

So, just so we are on the same page, when cvar is set to 1, Back button behavior is delegated to the engine’s built-in functionality, which is broken. When cvar is set to 0, the custom behavior is what Back button suppose to use (BP stuff). Is that correct?

If so, then what am I doing wrong in BP that back button doesn’t work at all when cvar is set to 0?

Thanks.

I just used the following setup in a clean project. This blueprint is placed in the default character blueprint for the First person template. This works on my end (Hello is printed to the screen when pressing the back button on the Gear VR Headset).

It is important to note that you must have the phone in the Gear VR headset for this solution to work. If you are using the developer mode (testing without the headset) the button on the phone will cause you to back out of the application.

84460-backbuttonhelp.png

Finally figured out why it wasn’t working - forgot to compile Game Mode BP where I set HUD class :confused:

Now when I build with full BP for UM per Epic’s docs I get the following in the Output log:

Cmd: OVRQUITMENU
Command not recognized: OVRQUITMENU
Cmd: OVRGLOBALMENU
Command not recognized: OVRGLOBALMENU 

Either way, it works now! Thanks a bunch!

Is anyone having issues with the progress bar that displays when you hold down the back button for a few seconds.

Mine is in the wrong position in UE4.13 - it worked fine in UE4.10 -

Does anyone else have an issue with the progress bar not displaying correctly in UE4.14? when I hold down to get to the global menu the bar only appears in my right eye and its at the top right of my headset (works fine on PC) - It worked perfectly in 4.11 in my Gear VR but not in an in any later versions for me.