I have a problem with my toggle buttons. When a user performs the Mouse Up of the toggle button outside the button area, the click is not counted.

Mouse Down and Mouse Up on the button area works. Mouse Down on the button and Mouse Up outside, does not work..

Just to avoid confusion, the Mouse Down is when you click, the Mouse Up is when you lift the finger from the mouse button.

Do you have any idea how to solve this?

I'm using Unity. Thanks for your help!

  • 1
    \$\begingroup\$ How about including the code that produces this unexpected behaviour? \$\endgroup\$ – dot_Sp0T Oct 29 '17 at 13:32
  • \$\begingroup\$ There is no code, I am using the toggle of unity, I am not creating the script for the behaviour \$\endgroup\$ – Grow Animation Oct 29 '17 at 14:33
  • 6
    \$\begingroup\$ This is how it is intended to work. It lets users cancel their clicks and also allows to differentiate between a click or a drag on a UI element. \$\endgroup\$ – Stephane Hockenhull Oct 29 '17 at 14:40

I guess you could record the mouse down event on the button and then instead of waiting for mouse up on that button, waiting for Input.MouseUp before triggering the event.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.