gaelbeltran Posted October 3, 2015 Share Posted October 3, 2015 Hello, I've come across a problem.Here's a simple implementation of what I'm doing:http://www.babylonjs-playground.com/#1PHXFI Basically, when I'm on my desktop, and I click the screen, the function gets executed immediately and my player moves. But on mobile it takes almost a second after touching the screen for the function to get executed. Is that how pointers work? Is there a way around that? Quote Link to comment Share on other sites More sharing options...
davrous Posted October 3, 2015 Share Posted October 3, 2015 It's immediate on my Windows Phone Lumia. On which phone are you testing? Which polyfill are you using? Hand.js or PEP?On some devices, there is a 300ms delay before firing the event. It's maybe your case. But 1s is huge!David Quote Link to comment Share on other sites More sharing options...
gaelbeltran Posted October 3, 2015 Author Share Posted October 3, 2015 It's a 2013 Motorola Moto G. Everything runs smoothly, it's just the touch. I'm using hand.jsIf I use event listeners, instead of babylon pointers it respons immediately:document.addEventListener( 'touchstart', onTouchStart ); Quote Link to comment Share on other sites More sharing options...
gaelbeltran Posted October 4, 2015 Author Share Posted October 4, 2015 @davrous I found the solution!I was investigating the 300ms delay on mobile devices and found this old blog post that talks about it:http://developer.telerik.com/featured/300-ms-click-delay-ios-8/<meta name="viewport" content="width=device-width, user-scalable=no">You just need to add this tag to your html file to prevent mobile devices from waiting for zoom pinches:Maybe we should add it to the documentation since it isn't very obvious and instant reaction on touch actions is very important in most games. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.