Unity Input.Touches if hold touch do nothing?
<p>Newbie...
Learning Unity to make mobile games and I have a small hex grid map that when touched the tiles change to a random color. I have a script for the camera to move it around with a finger press and zoom in an out with two fingers.</p>

<p>I want the tiles to only change color on a single touch, and not change when I pan or zoom the camera. I have been trying for two days and googled myself out and can't seem to figure it out. It seems pretty simple.</p>

<p>Here is the code that is called from Update() when a raycast hits an object. This just changes the hex's color but I want it to only do it when not panning or zooming the camera.</p>

<pre><code>void Touch_Hex(GameObject ourHitObject)
{
    Touch[] touches = Input.touches;

    if (touches[0].phase == TouchPhase.Ended)
    {
        MeshRenderer mr = ourHitObject.GetComponentInChildren&lt;MeshRenderer&gt;();

        mr.material.color = color[Random.Range(0, color.Length)];
    }
}
</code></pre>

<p>I've tried all different combos of phases etc but just cannot get it to work as I want it. I'm thinking deltaTime or deltaPostion is the answer but I can't work it out.</p>

<p>Cheers</p>