I have a code that when i touch a cube it changes its color, but the problem is that i dont want it to change color when my finger still on the screen.. please see the code below... my purpose is to make the boolean that called "touched" to false when my finger leaves the screen/not touching.. Code (CSharp): for(int i = 0; i < Input.touchCount; i++) { Touch touch = Input.GetTouch(i); // touch input Ray touchRay = Camera.main.ScreenPointToRay(touch.position); // touch position RaycastHit[] touchHits = Physics.RaycastAll(touchRay); // touch array for (int n = 0; n < touchHits.Length; n++) { if (touchHits[n].collider.name == "Cube" && !touched) // if i touch the cube and the bool 'touched' is false { Color newColor = new Color( Random.value, Random.value, Random.value, 10f ); renderer.material.color = newColor; // changes color touched = true; // here it stops changing the color after i touched // one time and my finger is still on the screen } } }