godot_openvr icon indicating copy to clipboard operation
godot_openvr copied to clipboard

Crash if OpenVRConfig isn't instantiated in Godot first

Open BastiaanOlij opened this issue 5 years ago • 2 comments

This is not by design :)

Found out on stream yesterday that if OpenVRConfig isn't initialized within Godot first that the engine crashes, presumably because certain default values aren't set up as the underlying singleton should be created even if the GDNative object isn't.

Workaround for now is to make sure you execute:

var openvr_config = preload("res://addons/godot-openvr/OpenVRConfig.gdns");
if openvr_config:
	print("Setup configuration")
	openvr_config = openvr_config.new()

before arvr_interface.initialize() is run.

BastiaanOlij avatar Oct 31 '20 11:10 BastiaanOlij

Yes, actually now that OpenVRConfig does more, we'd want to instantiate it anyway all the time.

beniwtv avatar Nov 15 '20 00:11 beniwtv

Indeed, which is why I never ran into this before but I guess we can't guarantee its instantiated.

Haven't found the cause yet though

BastiaanOlij avatar Mar 26 '21 03:03 BastiaanOlij