# \[Gear VR\] Back button functionality is broken

**URL:** <https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099>\
**Category:** XR Development\
**Tags:** Oculus, unreal-engine, Android, gear-vr, question\
**Created:** [March 29, 2016, 2:14am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099 "2016-03-29T02:14:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 29, 2016, 2:14am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/1 "2016-03-29T02:14:44Z")

</div>

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

I followed this tutorial to the tee [https://docs.unrealengine.com/latest/INT/Platforms/GearVR/GlobalMenu/index.html](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.

---

<div class="post-metadata">

**Author:** ![aussieburger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aussieburger](https://forums.unrealengine.com/u/aussieburger)\
**Post date:** [March 29, 2016, 11:48am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/2 "2016-03-29T11:48:37Z")

</div>

Hi ,

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

> **[\[4.11.0\] Preview 8 - Critical - GearVR build crashes after onPause](https://forums.unrealengine.com/questions/393421/4110-preview-8-critical-gearvr-build-crashes-after.html)**
>
> After a typical android onPause/onResume cycle the GameActivty crashes in it’s initial attempt to resume rendering (the onResume seams to do all it needs to though). This is critical because t makes publishing any GearVR app a no go. Steps to...

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

> **[\[GearVR\] Back Button behavior no longer as expected in 4.11 P6](https://forums.unrealengine.com/questions/382320/gearvr-back-button-behavior-no-longer-as-expected.html)**
>
> There has been a change in 4.11 Preview 6 where the back button goes instantly to the “Oculus do you want to quit?” screen. The functionality should be like it was previously where the back button can be controlled by us and we call this screen via...

Cheers,

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 29, 2016, 12:04pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/3 "2016-03-29T12:04:49Z")

</div>

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 😕

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 29, 2016, 2:57pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/4 "2016-03-29T14:57:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 30, 2016, 2:43am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/5 "2016-03-30T02:43:54Z")

</div>

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](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://s17.postimg.org/fozbnmwz1/ue4_gearvr_backbutton_BP.png)

[http://s11.postimg.org/h4e9lo5ep/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](https://drive.google.com/open?id=0BwE6dxM0O2PsRC1jakpBTXdsNTQ)

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 30, 2016, 4:35pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/6 "2016-03-30T16:35:28Z")

</div>

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](https://answers.unrealengine.com/questions/393421/4110-preview-8-critical-gearvr-build-crashes-after.html) ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 30, 2016, 6:03pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/7 "2016-03-30T18:03:00Z")

</div>

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](https://answers.unrealengine.com/questions/382320/gearvr-back-button-behavior-no-longer-as-expected.html)

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 30, 2016, 6:08pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/8 "2016-03-30T18:08:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 30, 2016, 6:57pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/9 "2016-03-30T18:57:24Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/b/ffb1a5e1f982ec5e148420794d5ab6df706b5504.png)

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [March 31, 2016, 3:27am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/10 "2016-03-31T03:27:33Z")

</div>

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

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!

---

<div class="post-metadata">

**Author:** ![Bushey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushey](https://forums.unrealengine.com/u/Bushey)\
**Post date:** [September 26, 2016, 9:27am UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/11 "2016-09-26T09:27:31Z")

</div>

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 -

---

<div class="post-metadata">

**Author:** ![Bushey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushey](https://forums.unrealengine.com/u/Bushey)\
**Post date:** [January 4, 2017, 10:12pm UTC](https://forums.unrealengine.com/t/gear-vr-back-button-functionality-is-broken/352099/12 "2017-01-04T22:12:06Z")

</div>

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.
