NeoSpark314/godot_oculus_quest_toolkit

vr_autoload requirement prevents plugin from working out of the box

Opened this issue · 4 comments

When you install from the asset library and try to run any example scene you get a "Parser Error: Expected a constant expression." on a line such as:

export(vr.CONTROLLER_BUTTON) var grab_button = vr.CONTROLLER_BUTTON.GRIP_TRIGGER;

I remember from last time it took quite a while to find out you had to add the singleton vr_autoload.gd as vr into the project. This problem was made worse because I was new and didn't know what autoloading was.

Is there a way to either: (1) make sure this startup error is useful in telling you to add this autoloading thing in, (2) put this requirement in bold in the description of the plugin, or (3) programmatically load the singleton at the start of each demo so this is doesn't need to be done?

Also, there's a typo on line 20 of OQ_UI2DLabel.gd.

onready var ui_color_rect : CenterContainer = $Viewport/ColorRect

should be

onready var ui_color_rect : ColorRect = $Viewport/ColorRect

Closely related issue is that you can't play any of the individual scenes when you have downloaded the asset until you insert the line:

vr.initialize()

into the _ready() function of the top node of the scene. Perhaps the lines:

if vr.is_initialized:
    vr.initialize()

at the beginning of each of these scenes would help people see what's supposed to happen.

Thanks for raising this point. You are right that using the toolkit from the asset repository is not as easy as it should be. I like the idea of adding a check in all the demo scenes that will print out a warning when the vr autoload does not exist and also call the initialize to work directly. I think we could also include a link to the wiki here on github (but it might need some more extension).

Regarding the type error: this is fixed on master but the asset has not yet been updated with a newer version of the toolkit.

Did you fix this one already?

pwab commented

Did you fix this one already?

I can confirm that it's not. I wanted to test hand tracking right now and had to do both steps:

  • add the singleton vr_autoload.gd as vr to the project
  • add vr.initialize() to the _ready() function of the scene

So thanks for this issue and your comments @goatchurchprime 😅


But it's already documented in the Wiki. So it's mostly an issue about guiding the user of the toolkit with the right error message texts to do the right steps or simply rtfm.