We’re about to finish the port of our game over from iOS to Android - everything is working great…but I’ve managed to get a Samsung Galaxy S8 to test on (it plays fine on my OnePlus5T), but the method of input (landscape full edge height for steering) we are using is triggering the home buttons to slide on and then of course another tap on that same direction vacates back to the home page. Is there way of surpressing this behaviour like there is in iOS? I noticed the “Defer system gestures on edges” isn’t in the Android player settings, but with Android having plenty of buttonless phones, it would be very useful. If i just use a tap it’s fine, it doens’t get triggered, but if, in the heat of battle, your tap is a bit more of a slide, the RECENT/BACK/HOME bar comes up and then it’s way to easy to kill the game by accident.
Any advice would be very welcome. (we are on 2018.4.12f1 LTS at the moment)
Just ran into this same issue, and wanted to bump this issue. I found the android docs for excluding areas from activating the gestures:
I’m wondering if unity has some native way to handle this? Or do I have to implement the Java syscalls myself. I’m also on 2018.4.12f1 but am willing to move to a new fix version if this has been implemented
I am in the process of porting my iOS game to Android and I also stumbled on this issue. I came up with a solution that seems to work well.
if (Input.touchCount > 0)
{
userTouch = Input.GetTouch(0);
if (userTouch.phase == TouchPhase.Began)
{
Vector2 touchPos = userTouch.position;
bool withinBounds = (touchPos.y >= DeviceData.screenHeightPxl * 0.1f && touchPos.y <= DeviceData.screenHeightPxl * 0.9f);
if (withinBounds)
{
// Do something with the tap
}
}
}
Essentially Line 8 ignores any taps that occur in the lowest or highest 10% of the screen. So if you are swiping up to get multitasking, or swiping down for notifications, the taps will be ignored. It seems to work well without any latency issues in my own game.