Hi everyone! The event of touching the display of phone doesn't work sometimes.
I make 2D mobile game and gamer has to tap the display very often. I have the event:
 if (Input.touchCount > 0) 
 {
 var test = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position); RaycastHit2D hit = Physics2D.Raycast(test, (Input.GetTouch(0).position)); 
 
 if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began && hit.collider && (hit.collider.tag == "TouchPanel" || hit.collider.tag == "Player") && tapCount > 0 && Time.timeScale == 1)
 
 ......
 
               But sometimes it losses touches (~3%) .....
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Why my ray doesn't hit the collider? 1 Answer
How do you detect if a touch is hitting an object? 0 Answers
Detect how long a tap is held 1 Answer
How to ensure raycasts hit colliders inside of trigger colliders on objects that have a rigidbody? 0 Answers
Best tool to do swipe/touch control of multiple objects in one scene 0 Answers