FbFGlobal_Dev Posted February 16, 2017 Share Posted February 16, 2017 Hi Everybody! So I have some hotspots floating around in z space. Each hotspot isPickable = true and each non pickable mesh isPickable = false. When I test on desktop it runs like a dream, but when I test it on mobile devices, the hotspots don't respond to any touch actions/click. Babylon version is v 2.5.0 I created a PG. The PG works great on desktop and mobile, but the PG is running version 2.6 alpha Is this something that was adjusted? Am I missing something? Can I change what version of Babylon being used in the PG so I can have a more accurate test? PG: http://babylonjs-playground.com/#PEJDE#8 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted February 17, 2017 Share Posted February 17, 2017 Did you include PEP ( https://github.com/jquery/PEP ) in your project? It is necessary to make pointer events work on most mobile browsers. davrous 1 Quote Link to comment Share on other sites More sharing options...
davrous Posted February 17, 2017 Share Posted February 17, 2017 Yes, Kesshi has probably provided the answer. Don't forget also to set the touch-action="none" HTML property on the canvas element. Quote Link to comment Share on other sites More sharing options...
FbFGlobal_Dev Posted February 17, 2017 Author Share Posted February 17, 2017 Thanks for the replies! Yup PEP is included, and yes touch-action="none" is implemented. I can get all the camera controls to work on mobile, but the "pick" still isn't working. I'm starting to suspect a non Babylon related issue. If I figure it out I'll let you all know.....The info might be useful to someone out there right? haha Thanks again! Quote Link to comment Share on other sites More sharing options...
FbFGlobal_Dev Posted February 17, 2017 Author Share Posted February 17, 2017 Hi everyone! so it turns out I needed to include a 'touchend' event listener as well as a 'click' event listener and remove the following from the "onPointerClick" function: if (evt.button !== 0) {return;} PEP is included, but for some reason the touchend events weren't doing their thing (All other touch events appeared to be firing without a problem). I tend to think this is all due to how I'm using the framework with other 3rd party platforms, and there was a conflict.....BUT if anyone else bumps into iOS touch events not being triggered when you have PEP loaded properly AND touch-action="none", give the above a try (it might put a smile on your face) 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.