How to capture multi-touch pointers using native js?

So with Safari, Babylon.js generally deals with MouseEvent objects, which doesn’t explicitly have the pointerId property but they can be cast to PointerEvent objects (or IPointerEvent objects, like we use with BJS for JS/Native purposes). In general, Safari tends to treat its pointerId values differently than other browsers, notably as very large negative numbers. Futhermore, only Safari iOS 13+ supports PointerEvent and its properties so older Safari iOS instances have a value of 0 assigned for pointerId. I’m guessing that for your iPhone 6+, it’s not running a Safari version that’s greater than 13 so that might be why it’s not triggering for onpointermove.

If you’re trying to get it to work on the older phone, you might have some luck by using the TouchList object from a TouchEvent and keeping track of pointer: TouchList.item() - Web APIs | MDN (mozilla.org)

1 Like