There have been many times where I rotate my camera and end up accidentally triggering a ClickDetector since they also sense right clicks, this has probably confused other people too. I suggest adding a property to restrict it to left/right/both mouse button/s, the default value being left.
Perhaps instead or in addition, you could tell the script whether a right or left click triggered the event.
Yes, definitely!!
Can’t you make the button check if you hit the button’s key?
Isn’t it set up to detect as a key?
Sorry to bump this, but any news?
I was reminded of this again today when I rotated my camera and triggered click detectors with the right click button!
I made a new click detector event, RightMouseClick and made MouseClick only happen for left clicks. I havn’t been able to turn this on yet because it had a bug, but the fix is coming out soon.
Not a fan of the API naming. IMO, would be more comfortable if there was an augment passed that told you which mouse button was clicked… Just having RightMouseClick and MouseClick is just weird that there’s only Right and not Left in the names.
We could possibly deprecate MouseClick and add LeftMouseClick. I didn’t want to add a second parameter for which mouse button was used to click because this is inconsistent with other API. It also doesn’t solve the problem of accidentally triggering MouseClick when moving you camera.
Deprecation would be good. ![]()