- Home /
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;
}
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.
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.
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).
Your answer
Follow this Question
Related Questions
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