- Home /
Detect maximum upper area of joystick?
Hello everyone, after many hours looking for information I have not found a solution to my requirement. I am using the Joystick Pack (1) for a 3D project , to be exact, a CoD Mobile style FPS.
Current: I have a joystick that controls the movement of my player. Currently it works if the vertical axis is greater than 8.0f (2), it will run and if not, it just won't run. (4)
public Joystick _joystick;
public bool _run;
if (_joystick.vertical > 8.0f){
_run = true;
} else {
_run = false;
}
It requires: I want to know how I can make it run if the handler is in the position indicated in the image (3) I understand that when it reaches such a limit, the vertical axis is 1f, but this changes when it is brought to the limit on the sides .
I hope you can help me, it is the first time I have published a forum and I am sorry for my English.
dia.jpg
(44.8 kB)
Comment