Developing for Oculus Quest

Introduction

Meta Quest with the Godot Oculus Mobile plugin. Before starting, there are two things you need to do: Exporting for Android page. This leads you through installing the toolset that Godot needs to export to Android devices. here.

Setting Up Godot

To get started open Godot and create a new project. GLES2 renderer. Due to the Quest’s GPU this backend is far better suited for the Quest. Copy the addons folder from the Oculus Mobile asset into your Godot project. Your project tree should look similar to this: Now you can start building the main scene:

  • ARVROrigin node first.
  • ARVRCamera and two ARVRController nodes.
  • ARVRController and rename that to LeftHand.
  • ARVRController and rename that to RightHand.
  • MeshInstance as a child node to our first ARVRController and create a box shape, resize the box so each side is set to 0.1. Now duplicate the MeshInstance and move it to the second ARVRController node. These will stand in for our controllers. Now add a script to the main node and add the following code: GDScript
    1. extends Spatialvar perform_runtime_config = falseonready var ovr_init_config = preload("res://addons/godot_ovrmobile/OvrInitConfig.gdns").new()onready var ovr_performance = preload("res://addons/godot_ovrmobile/OvrPerformance.gdns").new()func _ready(): var interface = ARVRServer.find_interface("OVRMobile") if interface: ovr_init_config.set_render_target_size_multiplier(1) if interface.initialize(): get_viewport().arvr = truefunc _process(_delta): if not perform_runtime_config: ovr_performance.set_clock_levels(1, 1) ovr_performance.set_extra_latency_mode(1) perform_runtime_config = true
    Before you can export this project to the Quest you need to do three more things. First go into the project settings and make sure that the main scene is the scene we run. Godot does not ask you to set this on export. Exporting for Android page do it now. If you didn’t you’ll have some red messages on this screen. Oculus Mobile VR. Then change the Degrees of Freedom mode to 6DOF. Now save and close the export window.

    Setting Up Your Quest

    these instructions to setup your device for development. Android logo that should be visible in the top-right corner of the Godot editor. When clicked, it exports your project and runs it on the connected device. If you do not see this Android logo, make sure you have create an Android export preset and that the preset is marked as Runnable in the Export dialog. The above does the bare minimum to get your project running on the Quest, it’s not very exciting. Holger Dammertz has made a great toolkit for the quest that contains a lot of scenes to get help you on your way including really nice controller meshes. here. here.