OpenXR and VR won't work

Godot Version

Godot 4.3

Question

`Hi, I’m experimenting with Godot for VR headsets. However, I’m having a problem. When I launch the app on my Meta Quest 2 VR headset, Godot appears in window mode as an Android app, not in VR (OpenXR) mode. I am using the XR Example which is compatible with Godot Version 4.3.

When exporting, it displayed the following error: scene/main/viewport.cpp:135 - Viewport Texture must be set to use it.

However, it no longer displays this error when exporting when I check Use XR in the Viewport Node Inspector.

Did you check the documentation about how to setup an XR project and how to deploy it to Android?

You have to configure some project settings and the export preset to enable XR

1 Like

Try this:

1 Like

There’s a problem: it only works on Godot 4.2, and I’m using Godot 4.3.

Here’s the VR example I’m using:https://drive.google.com/file/d/1r0_qayRZ2U8NdstfNfxbaumHyjfnvitd/view?usp=sharing

You should be able to let Godot convert it 4.3. I haven’t verified it, but the two versions should be interchangeable.

I just want a demo with hands that move with fingers and be able to select levels with the menu on a button interface. I tried on version 4.3, but it says a viewport error when exporting.

error: scene/main/viewport.cpp:135 - Viewport Texture must be set to use it.

Finally, after some time figuring out how to export to OpenXR, I managed to get VR mode to work, but there’s a problem: it’s only in a separate window, and I’m not able to move the hands. I converted the Godot XR Template to work on Godot 4.4.1.

I changed the main scene (main.tscn) to start_scene.tscn.

Godot asked me to update the hand meshes in the Project settings, and I updated the hand meshes.

I removed the Viewport Node in the start_scene.tscn scene that was causing this error.

error: scene/main/viewport.cpp:135 - Viewport Texture must be set to use it.

Here’s the template I’m using to test VR: Godot XR Template - Godot Asset Library

I followed this tutorial on YouTube and repeated it, but when exporting, it still displays the following error:

error: scene/main/viewport.cpp:135 - Viewport Texture must be set to use it.

When I launch the application on my Meta Quest, it displays a black screen with an error message.

Finally, after several tests, I realized that I needed the Godot Open XR Vendors plugin to be able to export to VR headsets. I use Godot OpenXR Tools for my VR hands.

When I export the app to a Meta Quest 2, it finally opens in full screen but keeps loading the app and never manages to open it.

I finally solved the problem.

If the application loads in a loop, it’s because I hadn’t configured the main scene, and now that I’ve configured it, it works. The hands are dark, but that’s because I haven’t set the EnvironmentMap, but that should be configurable in the Godot editor.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.