My raycast hits more than one object… it goes through them.
I need to stop this from happening.
Here is my code
`RaycastHit hit = new RaycastHit();
if(Input.touchCount>=0)
{
if(Input.GetTouch(0).phase.Equals(TouchPhase.Began))
{
// Construct a ray from the current touch coordinates
Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
if (Physics.Raycast(ray, out hit))
{
if(hit.collider.gameObject.tag=="Burbuja")
{
DestruirBurbuja(hit.collider.gameObject);
}
}
}
}
Thaks