jeremy948 Posted February 3, 2018 Share Posted February 3, 2018 Hello, I'm currently doing a shooter game for mobile devices with babyonjs. I use babylon GUI to display fixed buttons on my screen (for example a fire button). Everything worked before, but since few days GUI buttons are not working anymore with chrome on mobile device (it's working with safari and firefox). Do you have any idea about that ? thanks Quote Link to comment Share on other sites More sharing options...
brianzinn Posted February 3, 2018 Share Posted February 3, 2018 Sounds like it may be related to this one, but a resolution was not found. Can you reproduce in the playground? Quote Link to comment Share on other sites More sharing options...
jeremy948 Posted February 3, 2018 Author Share Posted February 3, 2018 At the beginning i tried to remove some elements from my game, but it looks like it's not working even for a very simple case. I tried this PG from the doc https://www.babylonjs-playground.com/#XCPP9Y#1 with 2 android devices (chrome browser). If i just try the PG from this url it's working. But if i download it (zip) to start it from my server it's not the same result : For the 1st android device (chrome version < 64) it's working (as well as iOS/safari devices). For the 2nd android device (chrome 64) the click doesn't trigger anything. It looks like a problem related to the last chrome version, it would be nice to make it works on any devices (i added PEP.js and touch-action none in <canvas> and in the css) Arshanwer 1 Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 4, 2018 Share Posted February 4, 2018 Facing the same issue, I stripped down my project and I tried but the tui button click works for mesh that is on top left corner but anywhere else. I know it does not make sense but I tried every possible way to figure out why and I couldnt.. Everything works well when its on PG irrespective of the chrome version. Quote Link to comment Share on other sites More sharing options...
jeremy948 Posted February 4, 2018 Author Share Posted February 4, 2018 I tried to find an other way to make buttons on the screen. In my shooter game (first person shoot for mobile), i 'm using FreeCamera with mouse input instead of touch input because i feel it much more natural to target something. The problem is multi touch is not working. I wanted to use scene.onPointerDown, then trigger something depending on pointer position (to replace gui buttons). But since multi touch is not supported, if i use one finger to move the camera and i use a 2nd finger to shoot, the first pointer (1st finger to move camera) is not moving anymore. The 2nd pointer take the lead, there is no multi touch. If you have any solution to manage multi touch with mouse input on device or some idea for controls in a shooter game, please share thanks Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 4, 2018 Share Posted February 4, 2018 Were you able to solve the android chrome issue you had? Quote Link to comment Share on other sites More sharing options...
jeremy948 Posted February 4, 2018 Author Share Posted February 4, 2018 No i still have this issue. Quote Link to comment Share on other sites More sharing options...
jeremy948 Posted February 4, 2018 Author Share Posted February 4, 2018 I found the problem : my device screen is 360x568 and pointer event got coordinates from that. But the scene was much bigger so the button coordinates didn't match with this pointer event coordinates. Thats why the button didn't trigger anything. I changed the viewport <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=1"> and it worked. Arshanwer and brianzinn 2 Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 5, 2018 Share Posted February 5, 2018 Great! I will try it out and see if it works for me... thanks alot for the reply.. Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 5, 2018 Share Posted February 5, 2018 Can i know in which android device you had this issue? Quote Link to comment Share on other sites More sharing options...
jeremy948 Posted February 5, 2018 Author Share Posted February 5, 2018 huawei p8 lite android 7. But it doesn't matter i think. This issue came with chrome update Quote Link to comment Share on other sites More sharing options...
Arshanwer Posted February 8, 2018 Share Posted February 8, 2018 On 2/5/2018 at 2:36 AM, jeremy948 said: I found the problem : my device screen is 360x568 and pointer event got coordinates from that. But the scene was much bigger so the button coordinates didn't match with this pointer event coordinates. Thats why the button didn't trigger anything. I changed the viewport <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=1"> and it worked. It worked! Thank you! brianzinn 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.