Oculus Quest 2 Unity



How To Use The Oculus Hardware Levels. Oculus offers you two hardware levels: CPU and GPU levels. And, different to what the documentation says, on Quest you have 5 Oculus hardware levels ranging from 0 (low power, low consumption) to 4 (maximum power, incandescent face). Level 0 might be just enough for 2D VR (don’t try this at home). The latest Oculus Integration SDK is available from Unity's Asset Store or from the Archive page. Upgraded Oculus Quest to Android 10. Yes, now Oculus Quest and Oculus Quest 2 have the same development environment! You can now attach debug symbols to an existing build previously uploaded to a release channel. Oculus Quest 2 Game Development Options News, Resources / October 13, 2020 October 13, 2020 / Engine, Godot, Unity, Unreal, VR October 13th is the official launch date of the Oculus Quest 2, and with millions of Quests now in gamer’s hands, some are no doubt going to want to figure you how to develop games for them.

  1. Oculus Quest 2 Unity Walkthrough
  2. Unity Urp Oculus Quest
Tutorials // Uncategorized

Solution#1:
– Place your file into some sdcard folder (by browsing there with Explorer), for example:”This PCQuestInternal shared storageDownloadmyfile.txt”
– Add script to load file:
var t = File.ReadAllText('/sdcard/Download/myfile.txt');
– From Unity menu select: Oculus/Tools/Create store-compatible AndroidManifest.xml
– Modify Assets/Plugin/Android/AndroidManifest.xml, add this line after </application> :
<uses-permission android:name='android.permission.READ_EXTERNAL_STORAGE' />
– Build & Run *Note: run fails, due to missing launch action.. so run the app manually in device (from library/unknown sources)
– Allow Read permissions when you start the app

Optional:
– You can enable LAUNCHER, to make Build & Run work, by replacing this line:
<category android:name='android.intent.category.INFO'/>
with:
<category android:name='android.intent.category.LAUNCHER'/>
– Can also disable permission request (while doing tests), by modifying this line:
meta-data android:name='unityplayer.SkipPermissionsDialog' android:value='false'
into:
meta-data android:name='unityplayer.SkipPermissionsDialog' android:value='true'
– Can also add Write permissions:
<uses-permission android:name='android.permission.WRITE_EXTERNAL_STORAGE'/>

My AndroidManifest.xml:
https://gist.github.com/unitycoder/a8a827311ea0837b06af6ccde85effec

Solution#2: (temporary fix)
check what permissions the app has:
adb shell dumpsys package <package_name>
then add permissions
adb shell pm grant <package_name> android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant <package_name> android.permission.WRITE_EXTERNAL_STORAGE

Resources:
– https://developer.oculus.com/distribute/latest/concepts/publish-mobile-manifest/
– https://forums.oculusvr.com/developer/discussion/78412/accessing-local-files

Tags: file, oculus, permissions, quest, read, sdcard, unity, vr

Related Posts

10 Comments + Add Comment

  • Hasn’t worked for me.

    I followed the instructions closely, replaced the manifest file with the example provided. I built and run, and then closed the app and opened it from ‘Unknown sources’. I believe it throws an error when running the line

    string testLoadString = File.ReadAllText(“/sdcard/Download/test.txt”);

    Although I don’t know how to see the error once it is not in Unity. Note that, even when I had not included the line

    meta-data android:name=”unityplayer.SkipPermissionsDialog” android:value=”true”

    it still didn’t ask for permissions when running the app.

    Any help would be greatly appreciated.

  • This worked perfectly on Quest 1, BUT not on Quest 2.
    Any idea if the path changed on Quest 2?

    Can pay 50$ via paypal for any insight leading to the solution 🙂

    Thanks
    Felix

  • Any news on if Quest 2 directory has changed? On if there are any new steps involved.

  • I had video file read problems in 2019.1 and it seems to be an Android 10 bug.
    It was solved for me by using Unity 2019.2.
    https://issuetracker.unity3d.com/issues/android-video-player-cannot-play-files-located-in-the-persistent-data-directory-on-android-10?_ga=2.2188601.882680562.1607255200-1472655325.1605534586

Recent posts

Discord Chat

Join UnityLibrary Discord chat https://discord.gg/cXT97hU

Recent Comments

  • on Using RenderDoc with Unity
  • on ffmpeg stream raw video into Unity Texture2D
  • on Deploy to Android device with wireless connection
  • on Vector3 maths for dummies!
  • on Waves Shader
  • on Matrix Playground Shader
  • on Vector3 maths for dummies!
  • on Flood Fill Algorithm
Quest

@unitycoder_com

Oculus Quest 2 Unity Walkthrough

My Tweets

Subscribe to Blog via Email

Tag Cloud

Unity Urp Oculus Quest

Connect