I’m trying to make a game on android using swipe controls for controlling my character (in 4 directions) and tapping for shooting.
I use this code for the swipe controls:
The problem i have with this is: when i “tap” my screen on a UI element (a button for example), it shoots aswell. I tried fixing this with:
if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
And then shooting afterwards, but that didn’t work.
I pause my game by doing:
Time.timeScale = 0.0f;
But I think when i (for example) press pause, the tap registers first (so it shoots) and then it sets the timescale, so checking for :
if(Time.timeScale != 0.0f;
also doesn’t work.
If anyone could help me out, it would be great!