Question by
foradvert06 · Jan 23, 2021 at 08:39 PM ·
touches
How to tell if player missed touching game object?
Using this code to destroy enemies when they are touched on mobile
private void OnMouseDown()
{
comboLevel++;
currentEnemies.Remove(gameObject);
Destroy(gameObject);
essence += (comboLevel / 2);
}
I want to add a combo system that will reward players for tapping enemies in a row without missing. I believe the onMouseDown will work for the destruction and registering of touching the gameobjects, but how can I get the information if they touched something that wasn't an enemy? This will be in AR, think enemies spawning around you and you tap them.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613023852im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Android Touch - how to know on which camera i touch 0 Answers
Please Help me with multitouch 0 Answers
mousePosition for Android 1 Answer
Input.touchCount always prints zero ? 0 Answers