Alternative for checking every frame if the mouse was used
Hello Im building a board game, where I need to check if the mouse clicked on a token, so Im afraid the only way to go is to call Input.GetMouseButtonDown(0) every frame in the update function right ? It seems pretty expensive, do you know a smarter way to not call it every frame?
Kind regards
Answer by tinglers · Mar 03, 2017 at 12:09 PM
Doesnt seem to work for me right now at first, maybe the script needs to be on the same plane as the box collider component...
i just tried it; somethings you may want to look at: make sure you use On$$anonymous$$ouseDown() not on$$anonymous$$ouseDown(), try making the plane a trigger, try having the plane closer to the camera, and ofc have the script as component of the plane edit: forgot mandatory "have you tried turning it off and on again"
Your answer
![](https://koobas.hobune.stream/wayback/20220612112342im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
User action too fast for Update() 2 Answers
Bullet to Mouse Position? 1 Answer
Projectile not firing from mouse location 1 Answer
Can't get a gameObject to follow my mouse 0 Answers
Raycast not drawing where i tell it 1 Answer