Oculus Go Development

On 6/23/20 Oculus announced plans to sunset Oculus Go. Information about dates and alternatives can be found in the Oculus Go introduction.

Oculus Quest Development

All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible. For additional information and context, please see Submitting Your App to the Oculus Quest Store.

Application Lifecycle Handling

This guide describes the VR focus states and the process to handle the lifecycle for Oculus applications built in Unity.

Focus States

Input Focus

With Dash we introduced the concept of input focus, or whether the user is focused on your app, or elsewhere. Adding Dash support to your app means correctly handling the times when your app is running, but the user’s focus is elsewhere.

To check if your app has focus input, query OVRManager.hasInputFocus every frame. If your app has focus hasInputFocus will return true. If the user’s focus is elsewhere, like when the user opens the Dash menu or removes their HMD, hasInputFocus will return false.

In single-player apps or experiences, you can pause the app, mute audio playback, and stop rendering any tracked controllers/hands present in the scene (Dash will use a separate set of hands).

Multiplayer experiences may wish to handle the loss of input focus differently. You’re required to hide the hands and ignore any input while the app does not have focus input, but you may wish to continue audio playback and the match in the background.

For more information, see HasInputFocus under OVRManager in our Unity Scripting Reference.

VR Focus

Similar to Input Focus, the runtime will also tell you if your app has VR Focus, or if any part of your app is visible to the user.

Your app could lose VR focus for a number of reasons, the most common is if the user exits to Home or switches to another app. To check if your app has VR input, query OVRManager.hasVRFocus every frame. OVRManager.hasVrFocus() will return false when you app is no longer visible.

When you lose VR focus the user can no longer see your app. You should stop submitting frames, drop audio, and stop tracking input. You may also wish to save the game state so you can return the user to where they left off in your app.

For more information, see HasVRFocus under OVRManager in our Unity Scripting Reference.

Application Lifecycle

Unity applications can listen or check for the following common events from the Oculus runtime.

Application start

When the application is initialized -

  • HMDAcquired
  • HMDMounted
  • VrFocusAcquired
  • TrackingAcquired

HMD unmount and mount quickly

When a user removes the HMD, then quickly puts it back on

  • When HMD is removed - HMDUnmounted
  • When HMD is replaced - HMDMounted

HMD unmount and mount with a delay

When a user removes the HMD, then puts it back on at a later time (~10 seconds or more)

  • When HMD is removed - HMDUnmounted
  • Then, after ~10 seconds - OnApplicationPause(true)
  • When HMD is replaced -
  • OnApplicationPause(false)
  • TrackingLost
  • HMDMounted
  • TrackingAcquired

HMD exits Guardian tracked space

The user’s HMD exits the defined play area

  • OnApplicationFocus(false)
  • OnApplicationPause(true)

HMD returns to play area

  • OnApplicationFocus(true)
  • OnApplicationPause(false)
  • TrackingLost
  • TrackingAcquired

Power button is pressed to turn off the display

  • OnApplicationPause(true)

Power button is pressed to turn on the display

  • OnApplicationPause(false)
  • TrackingLost
  • TrackingAcquired

Oculus button is pressed to open the System UI

  • OnApplicationFocus(false)
  • OnApplicationPause(true)

User selects “resume”

  • OnApplicationFocus(true)
  • OnApplicationPause(false)