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
7
Question by Inexperienced · Mar 04, 2015 at 05:18 PM · androidbugtouch

Touch no longer works on Android in Unity 5

I have tried both touch checking in Update and mouse events, and with Unity 5 neither events are fired.

The device is a Nexus 7 2012 running Lollipop for reference.

Comment
Add comment · Show 16
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 AnastasiaL · Mar 05, 2015 at 09:20 AM 0
Share

The same problem is reproduced on devices: - Samsung Galaxy S5 (G-900H) Android 4.4.2, - Samsung Galaxy S3 (GT-I9300) Android 4.3, - Samsung Galaxy $$anonymous$$ega (GT-I9200) Android 4.4.2 - on this device a part of UI is not even displayed, - Samsung Galaxy Note (S$$anonymous$$-P601) Android 4.4.2

We have upgraded our 4.6.x project to Unity 5.0.

avatar image thetnswe · Mar 05, 2015 at 09:30 AM 0
Share

same error..it doesn't work if you upgraded your old 4.6.x project. But if you create a new project and put UI stuffs in there, touch working back on android devices.. $$anonymous$$ind of weird but it really is a very big bug.

avatar image nashella · Mar 05, 2015 at 11:16 AM 0
Share

same issue here. 4.6.x project upgraded to Unity 5, UI is not working on Android device. (even with a new scene with just a canvas and a button). But a whole new project, no issue.

avatar image meat5000 ♦ · Mar 05, 2015 at 12:29 PM 0
Share

Its is probably in relation to the way the API Updater has changed the code, if it has changed at all.

Pull up your old code next to you new code and note the differences. Post them here, then we can see if they look correct or not.

avatar image Sospitas · Mar 05, 2015 at 12:36 PM 0
Share

I was just thinking the exact same thing. I created a test scene in Unity 5 with GUI to show Input.touchCount and it worked, but the exact same script didn't work in my 4.6-upgraded-to-5.0 project. Have any of you checked to see if a bug report has been submitted?

Show more comments

5 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Riwels · Mar 10, 2015 at 09:54 AM

I fixed this problem by replacing the unity activities from the AndroidManifest.xml, for this one:

 <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     </activity>

Now it's working to me with Amazon Ads and GameCircle. Try yourself with your plugins.

Original AndroidManifest.xml:

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.amazon.unity.AmazonMobileAdsPlugin"
 android:installLocation="preferExternal"
 android:versionCode="1"
 android:versionName="1.0" >

 <supports-screens
     android:anyDensity="true"
     android:largeScreens="true"
     android:normalScreens="true"
     android:smallScreens="true"
     android:xlargeScreens="true" />

 <application
     android:debuggable="false"
     android:icon="@drawable/app_icon"
     android:label="@string/app_name" >
     <activity
         android:name="com.unity3d.player.UnityPlayerProxyActivity"
         android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
         android:label="@string/app_name"
         android:screenOrientation="sensor" >
     </activity>
     <activity
         android:name="com.unity3d.player.UnityPlayerActivity"
         android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
         android:label="@string/app_name"
         android:screenOrientation="sensor" >
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />

             <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>

         <meta-data
             android:name="unityplayer.ForwardNativeEventsToDalvik"
             android:value="true" />
     </activity>
     <activity
         android:name="com.unity3d.player.UnityPlayerNativeActivity"
         android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
         android:label="@string/app_name"
         android:screenOrientation="sensor" >
     </activity>
     <activity
         android:name="com.unity3d.player.VideoPlayer"
         android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
         android:label="@string/app_name" >
     </activity>
     <activity
         android:name="com.amazon.device.ads.AdActivity"
         android:configChanges="keyboardHidden|orientation|screenSize" />
 </application>

 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 <uses-sdk
     android:minSdkVersion="9"
     android:targetSdkVersion="19" />

 <uses-feature android:name="android.hardware.touchscreen" />
 <uses-feature
     android:name="android.hardware.touchscreen.multitouch"
     android:required="false" />
 <uses-feature android:glEsVersion="0x00020000" />



Modified AndroidManifest.xml:

 <?xml version="1.0" encoding="utf-8"?>
 <manifest 
 xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.amazon.unity.AmazonMobileAdsPlugin"
 android:installLocation="preferExternal"
 android:versionCode="1"
 android:versionName="1.0" >

 <supports-screens
     android:anyDensity="true"
     android:largeScreens="true"
     android:normalScreens="true"
     android:smallScreens="true"
     android:xlargeScreens="true" />

 <application
     android:debuggable="false"
     android:icon="@drawable/app_icon"
     android:label="@string/app_name" >
       <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="fullSensor" android:name="com.unity3d.player.UnityPlayerNativeActivity">
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
     </activity>
     <!--- Amazon Ads -->
     <activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
     
 </application>

 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 <uses-sdk
     android:minSdkVersion="9"
     android:targetSdkVersion="19" />

 <uses-feature android:name="android.hardware.touchscreen" />
 <uses-feature
     android:name="android.hardware.touchscreen.multitouch"
     android:required="false" />
 <uses-feature android:glEsVersion="0x00020000" />

Comment
Add comment · Show 3 · 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 Sospitas · Mar 10, 2015 at 11:16 AM 1
Share

You are amazing! Thank you :)

avatar image rhodnius · Mar 27, 2015 at 02:11 AM 1
Share

Yep this worked for me! Thanks!

avatar image fermmmm · Apr 27, 2015 at 06:12 AM 0
Share

Not worked for me

avatar image
1

Answer by luniac · Mar 06, 2015 at 07:48 AM

This is how i fixed it after hours and hours and hours of BULL****...

i have neatplug social plugins, admob and facebook, they have stuff to do with the android manifest. I had to delete both plugins, all traces of them, then reimported the plugins and thankfully all errors went away and when i built to android the touches worked.

Touchscript was in no way involved...

Comment
Add comment · Show 3 · 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 meat5000 ♦ · Mar 06, 2015 at 01:55 PM 0
Share

Plugins. Read this.

http://docs.unity3d.com/$$anonymous$$anual/UpgradeGuide5-Plugins.html

avatar image luniac · Mar 07, 2015 at 12:43 PM 0
Share

i did read it, the settings seemed fine to me. and those plugins had nothing to do with touch functionality.

How do i find out if a plugin is 32 bit native or 64 bit native?

avatar image thetnswe · Mar 10, 2015 at 08:36 AM 1
Share

it's failing without any plugins like I said before... Create a new project in Unity 4.6.x -> Add new UI button -> Close the project... Open it with Unity 5.0 and touch no longer works.. it contains no plugins and not even a script.

avatar image
1

Answer by fermmmm · Apr 27, 2015 at 09:51 AM

I have the same problem but a little different, TouchPhase.Began is detected but TouchPhase.Ended or TouchPhase.Canceled is never called. Input.touches.Length doesn't update the value when there is no touch on the screen, so is never 0, only updates when pressing my finger on the screen. Bug report here: http://fogbugz.unity3d.com/default.asp?692519_b7i8q6l9oapd8ral 5.0.1 still has the problem.

Comment
Add comment · 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
0

Answer by felixwcf85 · Apr 27, 2015 at 03:38 AM

I have Unity 5 5.0.1f and the problem still exists as someone claimed that the problem is fixed in 5.0.1. Does anyone else has this kind of sh!tty problem?

I also converted my 4.6.+ project into 5.0.1 and the touch is not working on my Android phone!!!

Comment
Add comment · 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
0

Answer by wilberh · Dec 11, 2015 at 12:35 PM

Is touch available on Unity Remote 4, using Unity version 5.1.0f3 ?

Comment
Add comment · 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

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

13 People are following this question.

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

Related Questions

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

Touch.deltaPosition giving jerky movement on Android in Unity 5 2 Answers

Unity Bug, Letting User To touch two UI Buttons as same time (simultaneously) 1 Answer

TouchPhase not firing correctly - Android 3 Answers

Buttons touches dont work if touch splash screen 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