Arshanwer Posted January 29, 2018 Share Posted January 29, 2018 Hello everyone, I recently created a roadblock game using babylon js. Everything went well and was hosted 4 days ago. Today I tried playing the game and apparently the onPickTrigger does not seem to work anymore. No bugs are thrown either. What's weird is that the game still works perfectly on my Iphone but does not work on any android (using chrome browser) devices. Tried to look at the recent updates on babylon js to figure out what has gone wrong but I'm clueless . Any help will be highly appreciated as my client is fussing about this and I am stuck not knowing where to start from since it does not throw any javascript errors. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 29, 2018 Share Posted January 29, 2018 Can you explain more about your project or post the code (ie: does it work in a PG (playground))? Are you using "touch-none" css on your canvas - are you using PEP.js or hand.js? cheers. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted January 30, 2018 Author Share Posted January 30, 2018 The game is pretty big, working on posting the code on PG. No I am not using touch none and pep.js but I am using hand.js 1.3.11.. Let me try to explain it in detail about the problem. As you start the game it display’s a button “play” which is a mesh with a material on it. I use ActionManager onPickTrigger on the “play” mesh to dispose itself and start the game. This feature was working untill last week 27th jan 2018. After hosting on 27th it still was working fine. From yesterday it just stopped working on android devices (used chrome browser) but still works normal on iphone safari and chrome browsers. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 30, 2018 Share Posted January 30, 2018 I would start with touch-action="none". <canvas touch-action="none" ...</canvas> I ran on playground 3.2 alpha6 on my Android Chrome. Also, the playground is using PEP, but I think should work with hand.js as well. http://www.babylonjs-playground.com/?17 Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted January 30, 2018 Author Share Posted January 30, 2018 This is the first time I am trying to create a PG and Im travelling back to office. Will do it as I get there. The sample you gave does work on my android as well but not my game. Could you go to this link and check if the game works in your android ? http://surfmaticchallenge.com/ note: Lower your music volume as the game has an annoying background music playing. If you could pass me your email I can send you my project, if that is ok with you. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 30, 2018 Share Posted January 30, 2018 That is interesting as it works in Brave (based on all older Chromium), but not on Chrome on Android... send me a PM I'll take a look. Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted January 30, 2018 Author Share Posted January 30, 2018 I have PM you the link to download the files. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 31, 2018 Share Posted January 31, 2018 I switched to PEP.js and added touch-action="none" to the canvas and was able to start the game on Chrome for Android v 64.0. After I click a dirty shirt it zooms in and the game locks (I did win a 30% discount once!), but I think that is more related to what main.js is doing. Your program is ~3,000 lines of JavaScript, so hard to say what may be the cause. You are attaching and detaching the canvas a lot in the code. I have not seen that before, but I don't imagine that is helping a lot with pointer events. I would just remove all the code and start adding and see where it breaks. I don't have time unfortunately, but otherwise post a PG (playground) to reproduce and we can help. Also, it's convenient on Chrome for Android over adb to see pointer events in console (on Desktop) for degugging. That may be helpful. Good luck. Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted January 31, 2018 Author Share Posted January 31, 2018 Can i know whether are you using cen for pep.js and which version? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 31, 2018 Share Posted January 31, 2018 I commented out the hand.js script and added this: <script src="https://code.jquery.com/pep/0.4.3/pep.js"></script> Edited your canvas to add an attribute: <canvas touch-action="none" ...</canvas> I made also minor changes to the code. I don't know if they made a difference - I commented out the layermask, the first scene you created (which you overwrote right after), all the attach/detach canvas. I was able to get 1 dirty shirt max and then it locked up, so I was guessing something in the code. Wish I could help you more, but I'm super busy right now. Cheers. Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 1, 2018 Author Share Posted February 1, 2018 I tried that and still no luck, so I decided to strip down the project and removed all the chunks of code and left out just the homescreen play button and the logo. Used babylon action manager onpicktrigger. Weird thing is the picktrigger works for the logo but not for the play button. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted February 1, 2018 Share Posted February 1, 2018 Sounds like you've narrowed it down to something that could be reproduced in a PG (playground)? Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 2, 2018 Author Share Posted February 2, 2018 I think im close to figuring it out.. I included it PG.. it seems to work on that.. seems like a babylon script problem.. i will keep you posted. Thank you for the support GameMonetize 1 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.