Hello,
I am working on a mobile game and using OnMouseDown heavily. It works perfectly on the device but I keep on getting the warning
“Game Scripts or other custom code contains OnMouse_ Event Handlers. Presence of such handlers might impact performance on handheld devices”
Should I worry about it? If yes, what alternative do I have for OnMouseDown?
Thank You
I’ve also seen that note, but haven’t yet observed a heavy performance hit associated with it. Try it and see if you have any problems.
If need be, it’s actually really easy to get the screen position for each touch, get the main camera to convert that to a ray, then raycast to check what the touch is hitting (if anything), then go from there. Do this once per frame, and you have your own “mouse” handler.
Take a look at that answer:
OnMouseDown alternative for mobile
And yes you shouldn’t use OnMouseDown for mobile… it might not be a problem for now on ur device, but it might become on other devices