- Home /
Mobile Input Touch Tag Unaffected
Nothing happens when I touch anything tagged below -
void Update () {
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray,out hit, Mathf.Infinity) && Input.GetMouseButtonDown (0))
{
if(hit.collider.gameObject.tag == "Background")
{
print("Touched");
}
}
}
Also need it for mobile, but I can't get it to work with mouse.
Comment
Your answer
Follow this Question
Related Questions
How Activating a boolean fron another script(C#) 1 Answer
OnTriggerStay only happens when I move?(c#) 1 Answer
Trigger GUI with a key when colliding (C#)? 1 Answer
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer