Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save truedat101/8d1c9f5877ae0465e1f678327c5ef099 to your computer and use it in GitHub Desktop.
Save truedat101/8d1c9f5877ae0465e1f678327c5ef099 to your computer and use it in GitHub Desktop.
Set up Godot4/OpenXR + Quest2
# Overview
There are a bunch of official docs to review in order to get Godot 4 working in the context of OpenXR + a Quest2.
This gist attempts to summarize for those who struggle to collect documentation spread out across many links and entry points
into this topic.
## Docs
- https://docs.godotengine.org/en/stable/tutorials/xr/deploying_to_android.html
- https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html#doc-setting-up-xr
- https://developer.android.com/games/engines/godot/godot-configure
- https://docs.godotengine.org/en/4.0/tutorials/xr/index.html
- https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html#doc-exporting-for-android
- https://developer.oculus.com/documentation/native/android/mobile-device-setup/
## Tasks
- Install GoDot4
- Install Android Studio
- Update the Android Studio installation
- Android SDK Platform-Tools version 30.0.5 or later
- Android SDK Build-Tools version 33.0.2
- Android SDK Platform 33
- Android SDK Command-line Tools (latest)
- CMake version 3.10.2.4988404
- NDK version r23c (23.2.8568313)
- Install JDK 11 https://adoptium.net/temurin/releases/?version=11
- Set up system path to include JDK, android SDK
- Install Android drivers for Oculus Quest : ADB
- Update Oculus Quest system/os
- Turn on Developer mode for Quest
- verify device shows with command "adb devices" or in Android Studio device manager. Fix this before going futher. NOTE: Problem may be a cable
- Create a new project in Godot
- Under "AssetLib" : search for "OpenXR" and install the plugin called Godot XR Android OpenXR Loaders
- In Project "Settings", edit OpenXR to ensure checkbox Enabled is ON.
- Under Project, select "Install Android Build Template" and do the install
- Setup the basic project according to https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html . This should get you a basic project
- Follow the steps for setting up Android, specifically make sure you have a debug keystore set up: https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.htm
- Go to Editor -> Editor Settings and set up the Android section to include the debug keystore user and password
- If everything is ok at this point, you should see the "Remote Deubg" button active. It is between the play button and the button that looks like a directors cut thing. The UI sucdks for these details. You have to hover over the buttons to learn the function.
- click "Remote Debug". If all goes well you will see the app run on the Quest2.
- These full instructions don't really exist in any one place and it requires 4-5 links and probably 3-4 hours to set up first time.
## Relavant Issues
- https://github.com/godotengine/godot/issues/78427
@truedat101
Copy link
Author

Noting, some items are 1 time setup. Some things are needed every time you need to create a new OpenXR project with Godot4.

The demo sample project should be referenced somewhere and its steps. I actually was not able to get that one running ... it has like 10 errors/warnings and hangs while launching.

@truedat101
Copy link
Author

Would be great to have the equivalent of the VR Starter Project (I recall something like this from Godot 3.x days). It has a fairly complete example with a lot of things going on in the demo, though I don't recall if that was HTC Vive only, or a Quest thing.

@krisutofu
Copy link

Thank you for writing it up. Note that the "Godot XR Android OpenXR Loaders" Plugin is obsolete since Godot 4.2 and "Godot XR Open XR Vendors" should be used. In the Android export template, for some reason, I need JDK 17 and at least gradle 7.5 (which I had to change in the android/build/gradle/wrapper/gradle_wrapper.properties where it used gradle 7.4.x previously). The newest JDK 21 did not work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment