So I'm asking a very small game that uses touch to interact with a joystick. The problem is that when dragging the joystick, if the touch hasn't moved in a bit, the joystick slowly returns back to normal position, and I don't know why.
MY guess is that it considers the touch a "hold" and that does something with the drag and drop, but I have no idea.
Does anyone know why?
There's likely a mistake in your code. Please post your project file or a screenshot of events.
You can also check a few examples here:
howtoconstructdemos.com/category/virtual-joystick
Here it is. I followed a video I found on YT and it just does that, unless I missed something.
(Also sorry for mobile screenshot I don't have access to a computer rn)
If you need a link to the vid here it is:
youtu.be/Szsaa00TkhE
I downloaded the project from the video description and it doesn't have that problem you are having. So you must have done something wrong, it's impossible to say what exactly from your screenshot.
Develop games in your browser. Powerful, performant & highly capable.
Hmm. Maybe it is just the mobile touch? I've only been testing the game on my phone. I looked back at the video and have no idea what I missed.
Guess I'll keep looking.
Okay, I found the issue. It works just fine, but it just slowly goes back to normal position if my finger is outside the joystick outline.
You can download the project from the video and compare it with your code.