I am trying to make a simple game for mobiles where when i touch a gameobject , this looses its gravity.
I have tested only in android devices and the problem is , that sometimes i have to touch it many times in order something to happen.
The touch code i am using goes like this :
<<if (Input.touchCount > 0 Input.GetTouch(0).phase == TouchPhase.Began) {
var ray = Camera.main.ScreenPointToRay (Input.GetTouch(0).position);
if (Physics.Raycast (ray, hit)) {
if (hit.transform.gameObject == GameObject.Find(“Helicopter”))
hit.transform.gameObject.Find(“Cube”).rigidbody.useGravity = true;
Is there a more accurate way to use ?