- Home /
How can I force a device to recognize touches from large surfaces like the bottom of a hand?
Here is my code:
private void Update() { int fingerCount = 0;
foreach (Touch touch in Input.touches)
{
if (touch.phase == TouchPhase.Began || touch.phase == TouchPhase.Canceled)
{
fingerCount++;
if (fingerCount > 0
&& touch.position.x >= 300 && touch.position.x <= 730
&& touch.position.y >= 150 && touch.position.y <= 605)
{
if (!cRunning)
{
DebugText.text = "" + touch.position;
DebugText2.text = "Touch radius: " + touch.radius;
DebugText3.text = "Radius variacne: " + touch.radiusVariance;
PressColorButton();
}
}
}
}
}
I'm having an issue forcing my game to recognize a touch from large surfaces like 3 fingers put together or the bottom of a hand. My goal is to make my game more accessible for people who don't necessarily understand how a touch screen works or cannot tap the screen delicately with one finger. When I turn on developer options and show touches and touch location, a touch always shows up when I press the screen with the bottom of my hand and fingers pressed together so I'm at a loss for why my game wouldn't recognize that the player is touching the screen and perform the action. I've kept all the touches within the accepted area but I haven't had any luck, it'll only recognize touches from multiple separate fingers, 2 fingers held together, and the basic single finger. I've tried checking for canceled, moved, or ended touch phases but nothing seems to be working. Any advice as to how to solve this is greatly appreciated. The game is 2D on mobile and my target device is the Samsung Galaxy Tab A.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
LitJSON android problem 1 Answer
How to fix bold black bars on right side of the Game (on any device) 1 Answer
Joystick movement Android 2D 0 Answers