Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUnity export doesn't load #27130
Unity export doesn't load #27130
Comments
|
Hi,
Before that I got an error "inputSources is not iterable". Now I don't get an error, but it doesn't recognize the hands as controllers. I uploaded the page with the error to this URL: I don't have my own device, I ask people to try it, so I can't debug it on my own. Thanks for the help. |
|
Thanks for the testcase! We'll try and figure out what's going wrong. |
|
One of my guesses is that there's one frame with no inputSources. And I think that we can't see the "controllers" because that I check for gamepad. It works on the Oculus Quest Browser with hands, as they emulate the controllers. I added a page with console log, to test how many |
|
The problem is actually that this line is silently ignored for XRInputSourceArray, so it is in fact not iterable. I've got some code changes that should fix that and an automated test that verifies it. |
|
Thanks. So after this fix the InputSources in the specific page will work? |
|
@Manishearth please see the questions in the previous comment. |
|
@De-Panther We do not expose a gamepad, as there are no buttons. You can use gripSpace and targetRaySpace will work. |
|
Thanks, I'm currently reading that and other related issues. I do prefer the way that the Oculus Quest Browser works, with the emulated gamepad with one trigger. I tried to avoid Is it right to assume that: |
|
onselect is spec-wise guaranteed to be emitted when the trigger button is pressed, but it can theoretically be emitted when other buttons are pressed, up to the UA choice (it is allowed to designate multiple select buttons). No device/UA does this as of now, and I don't expect that to change Squeeze won't work for hands right now because for the hololens (and Quest iirc) there is overlap between select and squeeze. See immersive-web/webxr#997 for more info, input from a user's perspective is appreciated! I'm not super comfortable exposing a fake button just yet because the resolution of immersive-web/webxr#997 may involve exposing select and squeeze as buttons through a specially named profile. |
|
Remember, |
|
Thanks. I think that I'll check |
|
@De-Panther (re: your comment on the webxr issue) you misunderstand, the issue I linked is not about "some browsers do not implement the gamepad module". It's the reason I haven't added the gamepad module to servo yet, because there's a chance it may be resolved in a way that affects how we do it. The core issue issue is that for physical controllers "select" and "squeeze" are independent events, and you can treat them as separate buttons that the user may press separately. However, on hand tracking devices, select and squeeze can happen simultaneously in resposne to the same gesture, and in fact most select events trigger squeeze events. Content relying on this to not happen breaks. |
|
The reason I commented it there, is that I thought that my question is relevant to that discussion. "Why won't XRInputSource have trigger and squeeze state regardless of gamepad available or not? The part that may not related, is the fact that you don't have the data about trigger down/up or squeeze down/up. But this is why I asked about adding a gamepad object in case of hands, regarding of having actual gamepad. Working with events is great and simple in most cases, but when I anyway need to iterate on the InputSources, I want to have the data about the trigger/squeeze state there, rather than getting it from another place. |
|
@De-Panther Neither of your questions make sense in the context of the WebXR specification, however. The WebXR specification does not mandate hands to not expose gamepads, that's a choice we've made. The point of the select/squeeze events is precisely to expose trigger and squeeze state regardless of the availability of the gamepad, and if you want them in button form that's what the gamepad spec is for.
It's straightforward enough to handle the events and cache a boolean on the input source yourself. |
|
IMO, Usable: It's usable, and this is what I'll end up doing. But it's not straightforward. Having the Hand input events in the inputSource (as gamepad), would be the straightforward solution IMO. And as I understand, this is the direction that the discussion there is going to. So it's a good thing and I encourage it. |
Just cache on
Not quite, that's the issue. We can do this for Exposing select on the gamepad is not controversial. It's squeeze that's a problem. |
But I do want to get the analog value of the trigger/squeeze buttons if there is one.
So developers would need to check both squeeze button and overlappingsqueeze button? |
Right, read from gamepad if it exists, or read from selected if it doesn't. Hand input doesn't expose an analog value. |
|
And this is why I think that it's not so straightforward. Also, does the |
it's a couple lines of code: if (input.gamepad) {
selected = input.gamepad.buttons[0];
} else {
selected = input.selected;
}Ultimately it is not the goal of web specifications to do additional stuff that can be handled by frameworks. From the WebXR side, this is code that people can write, and ideally user agents implement the gamepad API, the problem is solved. Servo doesn't do the latter but you can still do the former.
It doesn't matter, if it happens after it will be exposed on the next frame. Frames occur quite rapidly after each other. When you are accessing Servo does indeed trigger it before the rAF, though; we only check for button presses right before rAF. |
|
Thanks :) |
|
Managed to run it on the Hololens emulator using the version from the store. |

https://de-panther.github.io/unity-webxr-export/Build/
Possible cause: