I’ve been trying for months to get a really good 8 way joystick (touch on mobiles) working(you dont need to lift your finger), I’ve created several different versions e.g Touchpad & Joystick, but they all suffer from locking up after a period of time (you have to release your finger from the device for a split second to reset everything), it seems that i just cannot be done successfully, unless the API using RectTransformUtility.ScreenPointToLocalPointInRectangle is buggy?, sometimes it stop responding and others the characters goes in the opposite direction, you are moving.
Has anybody got any ideas on this, or even some code idea’s would be appreciated, it’s doing my head right in, as it’s the only real problem I have with my game.
On the game I have options for two different control systems TouchPad Control / Joystick Control
I’ve been struggling to workout why the joystick has problems, I’ve finally tracked this down, AND I JUST CANNOT FIGURE OUT HOW TO FIX IT, so please can somebody help.
This is the problem.
if the user DOES NOT move the knob but presses the joystick lets say north for example, the value of Y is 1.0 but if they use the joystick knob it will be -1.0 as you can see, the player will move south if touched and not using the knob but will go in the correct direction if using the knob, I cannot swap them as the result is the same but backwards for one of them.
I’ve tried all sorts today to figure out a way around this problem, I’ve even tried to do my own control zones, it works in the touchpad but as the anchor points are different and cannot figure out a position on all devices as of yet.
I’ve posted my code
3033098–226943–JoyStickComponent.cs (8.64 KB)