Hi, here’s my problem.
I have cubes spawned at the top of the screen and falling down because of gravity.
Touching a cube makes it disappear and increase the score.
it works pretty good but as the speed gets higher the touch seems not working.
I’ve already tried editing the timestep values and other time settings in the Edit>project settings>Time tab, without any good result.
here’s my code, any help is appreciated.
foreach (Touch t in Input.touches) {
if (t.phase != TouchPhase.Moved && t.phase != TouchPhase.Stationary) {
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay (t.position);
if (Physics.Raycast (ray, out hit, 100f)) {
if (hit.collider.gameObject.tag == "cube") {
//SCORE UPDATE AND DESTROY() HERE
}
}
}
}