Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Eugene · Dec 21, 2011 at 06:41 PM · androidinputbugtouchtimeout

Android: Touch Input Timeout Issue

We have a game on the Android Market and it is plagued by an issue with the touch input. In the game you have to hold the accelerator button to drive. The problem is that after 32 seconds (on my device) all touches get cancelled. This is a known issue as some reviewers have given us a bad review on the market for it. This page was all I could find on the internet about it:

http://www.xoomforums.com/forum/motorola-xoom-general-discussion/4638-touch-input-timeout.html

This means that after you have held down the accelerator for 32 seconds, it cuts off and you have to press it again to continue driving. I have tested this in a completely blank project so I know it's not our project at fault.

You can try it for yourself: Just dump this script in an empty scene, run it on Android and hold the screen for 32 seconds or so. If your phone has the same issue, the touch count will reset itself to zero, cancelling all active touches.

function OnGUI() { GUILayout.Label("Touch count " + Input.touchCount); }

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Tseng · Dec 21, 2011 at 08:56 PM

Depends on how your code is implemented.

A good approach would be to to only react on certain touch phases. I.e. start accelerating if Input.touches[0].phase==TouchPhase.Began and stop only at Input.touches[0].phase==TouchPhase.Ended.

If an Input.touches[0].phase==TouchPhase.Canceled happened (which probably happens when you time out), you have to decide what to do (i.e. notify the users that he has to retap, or simply ignore it and have the car continue to accelerate).

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eugene · Jan 04, 2012 at 01:19 AM 0
Share

I tried something similar to this already but there were a couple of problems. The first you already mentioned is where the end phase is never fired when the touch is cancelled. The accelerator will essentially be "stuck" down until the player lifts their finger, touches the screen, then lifts their finger again.

The second problem with is that when the first touch is cancelled, any subsequent touch becomes the first touch. So I am holding the gas, it gets cancelled by the OS, I press another button which overwrites the first one and the gas gets cut off.

If this is a problem with the Android OS I am surprised there is not more information about it. I have done a lot of searching on Google and found nothing.

avatar image Eugene · Jan 21, 2012 at 10:31 PM 0
Share

Anybody? This is kind of a deal breaker.

avatar image
0

Answer by buffonomics · Feb 06, 2012 at 04:52 AM

if Input.touches[0].phase==TouchPhase.Canceled, intelligently persist the EFFECT of the touch using the coordinates of the canceled touch. Remove the effect of cancelled touch if total touchcount becomes > 1 as that means they have touched somewhere else.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eugene · Feb 06, 2012 at 09:43 AM 0
Share

The accelerator will essentially be "stuck" down in this state.

avatar image buffonomics · Feb 06, 2012 at 06:00 PM 0
Share

Well then I guess you have to incorporate this into your gameplay somehow. Acceleration lock = hyper speed. :)

avatar image Eugene · Feb 06, 2012 at 06:20 PM 0
Share

I think I'm going to submit a bug report to Unity. I think this is actually a problem with the Android OS itself but there has to be some way to fix it.

avatar image buffonomics · Feb 06, 2012 at 06:32 PM 0
Share

I don't think Unity can do a thing about it if it's an Android OS bug. Unity is simply a layer on top the OS and reports to you what the OS tells it. You would be better served submiting a bug to Google :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TouchPhase not firing correctly - Android 3 Answers

Infuriating bug: Android build occasionally dropping touch input. 0 Answers

Joypad help 0 Answers

Please confirm: Galaxy Stylus not readable directly in Unity 1 Answer

How to differentiate touches on mobile devices 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges