What would be the right way to assign other VR controller buttons?
For trigger-button I would use:
´´´
this.webXR?.RightController?.selectionDown
´´´
What would be the right name for example for “A” button? If I remember it correct, “A” is not occupied by other needle VR functions like scale
Hello there – we have an experimental AI bot that might be able to help you with your question. Would you like to try this out?
How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.
Hello Krempel. To assign other VR controller buttons, you can typically reference methods similar to those used for the “selectionDown” event. However, based on the information provided, it seems that WebXRController only exposes the specific events selectionDown, selectionUp, selectionPressed, and selectionClick (see the documentation).
For other buttons like the “A” button, you would have to handle them in a similar manner, provided that there are corresponding methods or properties exposed by WebXRController. If such methods or properties are not documented, you may need to listen for specific input events in the XR input source (XRInputSource), which is part of the WebXR API.
Unfortunately, without additional information provided in the documentation you’ve supplied, I can’t give you the exact name or method for the “A” button. It’s possible that the documentation has more details on this, or that you may need to rely on the underlying WebXR Device API directly for non-generic buttons.
As it stands, Needle Engine’s provided types documentation exposes the following relevant properties and methods related to the trigger button on the VR controller:
selectionDown: Returns true when the selection button (typically a trigger) is pressed down.
selectionUp: Returns true when the selection button is released.
selectionPressed: Returns true if the selection button is currently being pressed.
selectionClick: Detects a click, a quick press and release, of the selection button.
For more specific buttons like the “A” button on a particular controller, you might need to interact with the input property of WebXRController, which is an instance of XRInputSource, and handle its gamepad attribute accordingly.
Hi @krempel what the bot suggests should work. There are also some options to disable default behaviour of the WebXRControllers on the WebXRController class itself
Note that we’re currently working on a WebXR system update which will enable you to work with WebXR much more easily (and will also remove the need for any hacks)