Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze on touch in mobile browsers #4705

Closed
ze0nni opened this issue Dec 7, 2023 · 7 comments · Fixed by YoYoGames/GameMaker-HTML5#433
Closed

Freeze on touch in mobile browsers #4705

ze0nni opened this issue Dec 7, 2023 · 7 comments · Fixed by YoYoGames/GameMaker-HTML5#433
Assignees
Milestone

Comments

@ze0nni
Copy link

ze0nni commented Dec 7, 2023

IDE: 2023.8.2.108
Runtime: 2023.8.2.152

When game runned in mobile browser (or in desktop google chrome in mobile-mode) it freeze every time player touch the screen.

I found several forum posts with the same problem, but no one found a solution.

I tried replacing the HTML5 Runtime with what is currently in this repository but problem repeated.

I alos tested few games I found on itch.io (with tag gamemaker) and all have problem with touch on mobile devices.

This user show problem in a video:
https://www.youtube.com/watch?v=ikpA2gVSQJo&ab_channel=Dininho

Minimal project:
html5-lag.zip

@ze0nni
Copy link
Author

ze0nni commented Dec 7, 2023

I found information in Google chrome blog.

All I need add this in html template

<meta name="viewport" content="width=device-width">

I will try it later

https://developer.chrome.com/blog/300ms-tap-delay-gone-away?hl=en

@ze0nni
Copy link
Author

ze0nni commented Dec 7, 2023

Unfortunately this tag is already in the template

@ze0nni
Copy link
Author

ze0nni commented Dec 7, 2023

A found problem here here

If I change touchAction to "auto" freeze are disappear.

I have only android device and not sure this change not broke somthing for other devices.

@OneOnlineShow
Copy link

Hello, is there any news on fixing this problem? My HTML5 games are unplayable on mobile devices, although they work fine in the browser on a PC. When I press and hold on the game window area, I feel a vibration feedback, like I'm selecting text in a browser. The previous tips don't help at all.

@ze0nni
Copy link
Author

ze0nni commented Jan 30, 2024

@OneOnlineShow I haven't checked yet, but there is a possible solution:
YoYoGames/GameMaker-HTML5#391

@YellowAfterlife
Copy link

Some people report that adding the following to Code Injection in a new extension helped, which is likely similar to what was proposed with touchAction

<GM_HTML5_PreBody>
    <script>
        document.addEventListener('touchstart', e => {
            e.preventDefault();
            }, {passive: false})
    </script>
</GM_HTML5_PreBody>

@DiasFranciscoA DiasFranciscoA transferred this issue from YoYoGames/GameMaker-HTML5 Feb 13, 2024
DiasFranciscoA pushed a commit to YoYoGames/GameMaker-HTML5 that referenced this issue Feb 13, 2024
@DiasFranciscoA DiasFranciscoA added this to the 2024.4 milestone Feb 13, 2024
@c023-DeV
Copy link

Some people report that adding the following to Code Injection in a new extension helped, which is likely similar to what was proposed with touchAction

<GM_HTML5_PreBody>
    <script>
        document.addEventListener('touchstart', e => {
            e.preventDefault();
            }, {passive: false})
    </script>
</GM_HTML5_PreBody>

This works but then it breaks the "clickable_add()" buttons for touch. And I can't use any touch actions outside of the game canvas. Just something to be aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants