How to get touch data in AR mode?

Iā€™m trying to get the coordinates of a touch input, input.getpointerdown(0) responds to touches, but input.getpointerposition(0) returns (0,0) in AR mode.
any idea?


Original Post on Discord

by user 389432819056771072

Yes that is one area that needs updating and is not feature complete since in AR you get XRControllers for touches and they are not passed back through the input system fully yet

You could try working with them directly (you can access them via the WebXR component e.g. GameObject.findObjectOfType(WebXR).Controllers

Or you could use the window events: window.addEventListener(touchstart, (touches) => ...)

window.addEventListener("touchstart", e => {
window.addEventListener("touchmove", e => {
window.addEventListener("touchend", () => {
should get you started in the meantime :slightly_smiling_face:


by user 389432819056771072