Scene doesn't respond to pointermove events correcty

When initiating a pointermove event from outside the scene (say in a div that is laid overtop) the pointerX/Y in scene will update correctly when you drag into the scene on desktop, but not on mobile. On mobile the event never seems to propagate into the scene.

I have an example here

If you start the click/touch on the green div and drag into the scene you’ll see that the console logs work correctly on desktop, but on mobile they just never fire at all.

1 Like

Bringing in @PolygonalSun the input king

Hey @plafrance,

First of all, welcome to the forums! I can take a look to see what’s going on. Just out of curiosity, what mobile OS and browser did you test this on?

I was using an iPad pro running iOS 13. I tested it on Safari and Chrome and both had the same behavior. Not sure if it’s particularly helpful but using the iPad pro emulator in the chrome dev tools also has the same thing happen.

Thanks for the info. I was also able to recreate the behavior on an Android device with Chrome. Let me dig into the code to see if I can figure out what’s going on.

1 Like

Hi! I am also running into this issue? Any luck diagnosing the problem?

@PolygonalSun any update ???

Sorry about the wait on this. I’ve been verifying a couple of scenarios and ruling out parts of our input code. I am hoping to find the root cause today.


So here’s what I’ve found. I’ve tested examples with and without using Babylon.js. It looks like this behavior is the same in both scenarios so I don’t think that this is a bug for BJS. The behavior that I’m seeing is that when the drag is started, the element being touched will serve as the reference until the touch is released. If there are no events associated with it (even if you leave the bounds of the element to move over one that does have events), nothing will happen because it thinks that you’re doing something with the original element. Basically, until you lift your finger, the HTML element still thinks you’re working with it.

Ah ok yea that makes sense. I wasn’t sure if it was something specific to Babylon or if it could potentially be an issue with how the events are triggered on mobile devices. I will keep looking around to see if there might be a way to get around it.

Thanks for you help!

1 Like