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 WarriorGames · Apr 07, 2015 at 01:02 AM · androidunity 5touch

Android Touch Input works perfectly on Samsung Galaxy S3 but breaks on Galaxy S4

Hey Guys,

I've got a game which has simple touch input which works perfectly on my Samsung Galaxy S3, but when I load the exact same APK onto a Galaxy S4, the touch input not longer registers touch movement (required for aiming) but still fires on touch release.

Any ideas to help fix the issue would be most appreciated.

Touch works fine with Unity Editor

Touch works fine with Unity Remote on Galaxy S4

Regards

Andrew

To be clear, the weapon draws and fires fine, it's the aiming which works on S3 but not S4. This code also worked fine on the S4 in earlier builds. Code as requested:

 //If the weapon can be fired, calls the Draw function to aim before 
 //Releasing the weapon.
 
 if (!_hasFired && !_hasDrawn && !_mySceneManager.UIButtonClicked && ((Arrow != null && !Arrow.IsActive) || isOilPot))
             {
                 if (!isOilPot && !isMultiArrow) Arrow.IsActive = true;
                 StartCoroutine("Draw");
             }
 
 //Aims using input from the touch zones defined in SceneManager
 IEnumerator Draw()
     {
         _hasDrawn = true;
         if (WeaponAmmo != null) WeaponAmmo.SetActive(false);
         if (BowAnimator != null && HasDraw) BowAnimator.Play("Draw");
 
         while (_mySceneManager.UIFiring)
         {
             float deltaZ = 0.0f;
             if (_myGameManager != null && TouchScript != null) { deltaZ = TouchScript.GetDirection() * mouseSensitivity * _myGameManager.InvertTurretModifier; } else Debug.Log("TouchScript is null"); 
             angleOffset += deltaZ;
             angleOffset = Mathf.Clamp(angleOffset, -rotateAmount, rotateAmount);
             eulers.z = Mathf.Lerp(eulers.z, initialZ + angleOffset, Time.deltaTime * (1.0f / lag));
 
             transform.eulerAngles = eulers;
             yield return null;
         }
         if (_hasDrawn && !_mySceneManager.UIFiring)
         {
             StartCoroutine("Fire");
         }
         yield return null;
     }
Comment
Add comment · Show 3
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 DoTA_KAMIKADzE · Apr 08, 2015 at 01:07 AM 0
Share

Update your question with code of how you use touch and if you use Unity input then post its settings as well.

No one will be able to help you at least without that^ unless you're lucky and someone got exactly the same problem before as you have now.

avatar image WarriorGames · Apr 08, 2015 at 07:59 AM 0
Share

Uploaded code as requested, but considering it worked fine on previous builds on both S3 and S4, and it hasn't changed between builds, I highly doubt that's where the problem is.

avatar image DoTA_KAMIKADzE · Apr 08, 2015 at 02:43 PM 0
Share

Not that code, you said yourself that it has to deal something with registering touch movements and your touch clicks work as expected so the problem might be in the way you "register your touch movements". As far as I understood your code it is in your Line #20 where you get your touch movements, add Debug.Log to check deltaZ value components and test it on your devices and if S4 returns something incorrect then that is clearly the problem with one of your deltaZ componenets (most likely TouchScript), and if so then we have came back to my previous post^ about updating your question with code of how you get your touch input (e.g. your TouchScript.GetDirection() and all of its components if it has any).

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Why is this raycast still hitting ground below a UI button, even after I pass a check to see if finger is above button (as per Unity tutorial) 1 Answer

EventSystem.current.IsPointerOverGameObject(t.fingerId) - Not working on Android builds - Unity 2 Answers

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

Input.GetTouch(0).deltaPosition.x returns 0 sometimes 0 Answers

How to select gameobjects on android by touching on them? 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