Question by
umurcuk · Jul 26, 2017 at 11:47 PM ·
androidinputtouchgetmousebuttondown
UNITY 2D ANDROID DEVICE TOUCH PROBLEM
Hi , after clearing the unity's cache and update it to latest version, the input raycasting to the sprites on the scene doesn't work anymore in the android device. It is working on Unity editor, I can click them with the script below, but it isn't working on a android device. By the way I didn't change any script or line about clicking or raycasting below I just added the Facebook sdk a while ago. Please help me about it ...
if (Input.GetMouseButtonDown(0))
{
RaycastHit2D hit= Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), -Vector2.zero);
if (hit.collider != null)
{
if (hit.collider.tag == "numberBox" || hit.collider.tag == "question")
{
//DO SOMETHING
}
}
}
}
Comment