Question by
berrangejanko · Jan 25, 2021 at 06:36 PM ·
androidinputmobilemousemouseposition
How to check if a player click on a object: Android Mobile
Is there a way to see if an player clicked on an object on mobile (android)?
and
does "Input.mousePosition" work with mobile?
Comment
Best Answer
Answer by berrangejanko · Jan 25, 2021 at 06:47 PM
You can use
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
//your code
}
It is not the best way of doingit, but it works