-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the openvr tutorial to godot 4.4 #162
Comments
Are you trying to do this with master, or with #155 applied? Overlays don't work at all on master right now. Feel free to ping me in one of the Godot discord servers as well until I get around to an example. |
I have successfully cloned your repo, pulled #155 into master, and grabbed the release files that were generated by GitHub Actions. The only thing that's holding me back now from having this fully working is an example of what my node tree needs to look like to get this to work. So far I have the OpenVROverlayContainer as the root, a SubViewport under it and a ColorRect to hopefully see something. On the root node I have the following GD Script: @tool
extends Node
var _xr_interface_openvr : XRInterfaceOpenVR
func get_interface():
return _xr_interface_openvr
func start_xr():
if _xr_interface_openvr:
print("Capabilities " + str(_xr_interface_openvr.get_capabilities()))
print("Target size " + str(_xr_interface_openvr.get_render_target_size()))
_xr_interface_openvr.application_type = 2
_xr_interface_openvr.tracking_universe = 1
if _xr_interface_openvr.initialize():
get_viewport().use_xr = true
print("Initialised")
else:
print("Failed to initialise")
else:
print("Interface was not instantiated")
func _enter_tree():
_xr_interface_openvr = XRInterfaceOpenVR.new()
if _xr_interface_openvr:
XRServer.add_interface(_xr_interface_openvr)
func _exit_tree():
if _xr_interface_openvr:
XRServer.remove_interface(_xr_interface_openvr)
_xr_interface_openvr = null This so far only yields a window that briefly opens and then closes itself. Any help would be eternally appreciated. |
Looking at this today. |
Also fwiw I have not tested mono, as it isn't required for this repo and I have a large enough build matrix in my head already 😅 |
Don't worry about the dotnet requirement. @Toxic-Cookie required it but it's not necessary for this tutorial. |
The main script should be a lot simpler, the interface management is handled by the autoload script. You're also never calling your Make sure you have the singleton enabled in project settings, then you can do this:
Note I don't even bother with the You also don't need Edit: Oh, and move the overlay's absolute position out by a few meters or it spawns inside your feet 😆 |
@Toxic-Cookie was struggling to create a Godot 4.4 dev 7 demo with openvr overlays.
res://addons/godot-openvr/openvr_autoloader.gd
The text was updated successfully, but these errors were encountered: