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 Neklan · Jul 11, 2014 at 02:05 PM · iosiphonetouch screen

Cant't recognize touch on iOS, but on Android and Mac it's ok

Hi, have a problem.

trying to deploy ma unity app on the iphone, but there is a problem. i have one scene, where you are clicking on objects and the objects playing sounds after click. Everything going just fine on the Android device and the Mac, but on iPhone it seems, like it's not listening to the touches on the screen... tested on the iphone 4G, iphone 5S and ipad air 3, same results..

this problem occurs yesterday, before that it was fine on all tested platforms..

any advices please?

thank you very much

Comment
Add comment · Show 5
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 Razacx · Jul 11, 2014 at 02:29 PM 2
Share

You might want to show us some of your touch-handling code so we can figure out what is wrong

avatar image Neklan · Jul 11, 2014 at 06:00 PM 0
Share

hi razacx, for me its clear that there is not problem in touching event, because i havent change it and before yesterday everything worked ok.

can be there some problem with my settings of unity player setting or xcode?

avatar image Graham-Dunnett ♦♦ · Jul 11, 2014 at 06:05 PM 0
Share

Input.GetTouch() is known to work. Typically you use the touch position, and fire a ray into the scene to work out what it hits. Hard to see how that can't work. Where I have seen people have problems is where they use Unity's mouse handling code and scale GUIs.

avatar image Neklan · Jul 14, 2014 at 08:20 AM 0
Share

I'm using this code for recognizing the touch of objects

                 foreach (Touch touch in Input.touches) {
                     if (touch.phase == TouchPhase.Began) {
                         RaycastHit hitInfo = GetObject (touch.position);
                         if (hitInfo.collider != null) {
                             if (hitInfo.collider.tag.Equals ("Instrument")) {
                                 Instrument script = hitInfo.collider.gameObject.GetComponent ();
                                 if (script != null) {
                                     script.Hit ();
                                 }
                             }
                         }
                     }
                 }

Could it be by updating to the newer version of Unity?

avatar image Neklan · Jul 14, 2014 at 08:47 AM 0
Share

Ok guys, i found the cause of the problem, now i'm searching for the solution. The touch problem is caused by rotating the screen orientation. In the game i'm rotating from the portrait to the landscape left. when i left the portrait, the touches are just ok and everything is going well. do you have any suggestions? :-)

1 Reply

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

Answer by Neklan · Jul 14, 2014 at 11:33 AM

I have resolved it. It seems that there is a bug in Unity version 4.5.1, when you rotate screen orientation manually in the code, the x coordinates are in negative numbers, and thats why the input events are not working. Bug was reported, but still in version 4.5.2 it is not resolved.

So solution for me and for others is to downgrade to the version 4.5.0 where this working well.

Hope that this post can save someone 50 hours of his life :-D

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

Unity iOS sdk question 1 Answer

iOS Shader - Emulator vs Device Inconsistency 0 Answers

WebCamTexture and VSync (iPhone 4) 3 Answers

Depth of Field Mobile 0 Answers

Making the switch to iPhone 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