I have a switch button, it toggles a value on clicked or on touched.
The problem is in some browsers like in chrome, when I click the button it also triggers the touched event, so the value togles and togles back again to the initial state.
How can I workaround this problem, thank you.
Develop games in your browser. Powerful, performant & highly capable.
You only need clicked OR touched right? Was there a reason you were using both?
the touch object also emulates mouse clicks, so just use onTouch for both.