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
0
Question by hubatish · Apr 07, 2015 at 11:10 AM · androidunity5touch

Touch disabled on Android, Unity 5

I just upgraded a project to Unity 5.0. Unfortunately, doing so seems to have broken touch in our Android build. I built a couple of dummy scenes trying OnMouseDown events, Unity 5 UI Buttons, and Unity GUI.Button, but none seem to work.

It seems that might be related to OnMouseEnter events mixing with Touch calls (though we don't use Touch anywhere), so I tried deleting almost everything from the project, but it still doesn't register input. It does seem to work when I create a new project - I'm guessing it's something in Project Settings but not sure what.

I realize there's probably not a lot to go on here, but has anyone else encountered a similar issue (with Unity 5 or in general)?

--edit-- I tried a build with this code:

 protected void Update()
 {
     Vector3 mPos = Vector3.zero;
     if(Input.touchCount>0)
     {
         mPos = Input.GetTouch(0).position;
         Debug.Log("touchPos " + mPos);
     }
     mPos.z = 10;
     Vector3 cMPos = Camera.main.ScreenToWorldPoint(mPos);
     transform.position = cMPos;
 }

but got no debug.log messages and the object didn't move.

Comment
Add comment · Show 2
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 hubatish · Apr 08, 2015 at 01:51 PM 0
Share

Also, I just started using Unity Remote 4 recently... Tried running with that and it seemed to work. Hmm...

avatar image hubatish · Apr 10, 2015 at 01:19 PM 0
Share

Found this excellent link - I seem to have the same problem: http://answers.unity3d.com/questions/915011/touch-no-longer-works-on-android-in-unity-5.html

Seems plugins and the Android$$anonymous$$anifest may be the culprit; though so far it hasn't worked

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by hubatish · Apr 11, 2015 at 02:55 PM

Check out plugins. In my case the Stan's Assets Android Native plugin needed updating, so I removed it and re-imported it. This remade my AndroidManifest and fixed my problem.


Also, this question is pretty much the same as mine, though their solution was different: http://answers.unity3d.com/questions/915011/touch-no-longer-works-on-android-in-unity-5.html

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 Veldars · Apr 07, 2015 at 11:35 AM

I've encountered a similar issue and i have fix it by adding a box collider on my UI Button.

Comment
Add comment · Show 1 · 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 hubatish · Apr 08, 2015 at 02:13 AM 0
Share

Unfortunately I don't think it's related to the type of button - I tried a bunch as mentioned.

I also ran this in an Update loop but got no output: if(Input.touchCount>0) { Vector3 mPos = Input.GetTouch(0).position; Debug.Log("touchPos " + mPos); }

  • going to add this as edit to question.

avatar image
0

Answer by liortal · Apr 11, 2015 at 04:55 PM

This is a bug that happens in some cases.

In Unity 5.0.1 this was resolved, as written in the release notes here: http://unity3d.com/unity/whats-new/unity-5.0.1

Android: Fixed crashes / touch problems when applying ForwardNativeEventsToDalvik to a non-NativeActivity.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Buttons touches dont work if touch splash screen 1 Answer

Converting screen coordinates to world coordinates 1 Answer

Fix Rotate Object with touchscreen on X and Y axis 0 Answers

Testing in Unity5 0 Answers

Since upgrading to 5.0: Unable to convert classes into dex format. See the Console for details. 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