Touch.stationary too sensitive

I want to detect when the user presses and hold their finger on the touch but exit when they move their finger. It is working but the problem is that it is too sensitive. When I move my finger a little bit, it cancels out. I want it to cancel when you move it away too much but stationary is not working that well. Any help would be appreciated.

foreach (Touch touchScreen in Input.touches) {
					

						if (touchScreen.phase == TouchPhase.Stationary) {
								clickInfo.text = "Touching";
						} else {
								clickInfo.text = "Stopped Touching";
						}

						
				}

EDIT: What I mean by sensitive is that when I press and hold the screen, stationary is true and when I press it harder even without moving my finger, stationary becomes false then true again. This breaks my game mechanic.

I’m unaware of any way to change the Stationary sensitivity (which doesn’t mean there isn’t one), but you could solve it in code by giving a bit of wiggle room to a TouchPhase.Moved:

 if ((touchScreen.phase == TouchPhase.Stationary) || (touchScreen.phase == TouchPhase.Moved && touchScreen.deltaPosition.magnitude < someValue)) {

I don’t know your game mechanic, but there may be issues here with the behavior and multiple touches.

1 Like

So basically touch.stasionary is too sensitive and you can just have a workaround. Hopefully somebody will find this in need of help!

 public class LoadScene: MonoBehaviour
 {
    Vector2 Began;
 
     void OnMouseDown()
     {
         if(Input.GetTouch(0).phase == TouchPhase.Began)
         Began = Input.GetTouch(0).position;
     }
 
     void OnMouseUp()
     {
         if((Began - Input.GetTouch(0).position).magnitude < 5)
             SceneManager.LoadScene(2);
     } 
 }

this script is attached to a body with a collider set to isTigger. When you first touch the body, it gets your touch, and when you lift it up and there is a difference, it will return false. otherwise, there is no difference from the 2 points and it will return true. Enjoy !