I have been working on my game recently where i decided to use Android as the platform . I implemented a swipe detection for the game that changes player direction. Now to detect a touch event i used Input.GetTouch(0) since i only needed one touch to go about everything(multi-touch not required). Created a prototype build few days back , touch worked perfectly on my Android Phone. Built the same code with a few updations into my UI and the Input.GetTouch(0) has stopped working on the same phone. FYI:-When i test the game through UnityRemote 4 touch is detected on my phone.
can you revert to the previous build? if so load that one back on to the phone & see if it still works. Maybe your phone received an update between your two tests?
I'll try that when i reach home. There is one more thing i noticed but forgot to put that down. I am also cheking for a double tap which uses Input.GetTouch(0).tapCount . This is working fine. i have a MainControlller class where the functions are defined as:- Code (CSharp): class MainController{ . . . . . public bool doubleTapCheck(){ //Checking Input.GetTouch(0).tapCount } public int SwipeDirectionX() { //Store Input.GetTouch(0) in a Touch variable //Logic for checking Swipe Direction and returning //the results. } }
Well I got this working. Switched platform to some other platform in build settings , switched back again to Android . Created a build and things were working .