Mobile Joystick with button

Hello,

I am trying to code mobile joystick based on this [SOLVED] Help with virtual joystick - #5 by eproasim .
It works well, but when I tried to add button and moving joystick while clicking on the button, the joystick will flick to the position of new touch.
Is there any way to make touch be registered only by one event listener?
Here is sample project: https://playcanvas.com/editor/scene/1236995

Thank you!

Hi @Regular,

You best place to start might be the multi-touch example project here:

https://playcanvas.com/editor/scene/475042

I can’t speak with any authority to if this will work, but I would guess you would want to check on the drag events, like drag:start, drag:move, and drag:end, which touch ID is causing the event and change the behavior based on that.

Again, no idea if that will work, and I unfortunately don’t really have time to try it at the moment, but that’s where I would start to see how far I could get.

2 Likes