News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • October 18, 2018, 02:22:57 AM

Login with username, password and session length

Author Topic: Easy Touch Joystick stuck  (Read 6220 times)

Offline Hazneliel

  • Newbie
  • *
  • Posts: 6
Easy Touch Joystick stuck
« on: January 09, 2014, 06:04:28 AM »
Hello, I have been testing Easy Touch on an Android device, there is a bug that sometimes the Joystick gets stuck in one direction like if my finger was holding it, buy it keeps stuck that way, I try to touch everywhere else to unstuck it but it will random self unstuck.

Why is this happening?

Thank you very much

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #1 on: January 10, 2014, 02:31:38 AM »
Hi,

I'll try to reproduce the case in order to correct.

Nicolas

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #2 on: January 10, 2014, 04:44:38 PM »
Hi,

I can't reproduce the case.

But could you add these lines to the method of UpdateJoystick in EasyJoystick.cs script:

Code: [Select]
if (EasyTouch.GetTouchCount () == 0) {
    joystickIndex = -1;
}

And tell me if it solves your problem?

thank you

Nicolas

Offline Hazneliel

  • Newbie
  • *
  • Posts: 6
Re: Easy Touch Joystick stuck
« Reply #3 on: January 13, 2014, 07:40:31 AM »
I added the line of code, the problem is still present but this time the joystick gets stuck on the center of the pad, previously to your code it would get stuck to the direction I was pressing, now because your code it returns to the center but it gets stuck there

Here I attach an image to show you how Im not touching the screen but the joystick is there stuck like if I was touching the screen.



Once it gets stuck that way I cannot unstuck it, I keep pressing other parts of the screen but it unresponsive.

To try to reproduce it here is my settings:

Im using the Unity 4.3 2d project
Im using unity 4.3.2

My Joystick has these settings:
Dynamic joystick: enabled
Free area: Left
Area radius: 70
Touch Radius 30
Restrict to area: unchecked
Reset Finger exit: unchecked
Interaction type: include
Enable x axis: checked
Enable y axis: unchecked

I also have 2 other easy touch buttons on the right, they are working correctly even when the joystick is stuck

This is happening on many android devices.

I hope you can help me with this.

Thank you

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #4 on: January 13, 2014, 04:52:59 PM »
Ah ok,  I didn't understand you were dynamic mode, and you were talking about the whole joystick, not only the central part.

It is clearer now

Nicolas

Offline Hazneliel

  • Newbie
  • *
  • Posts: 6
Re: Easy Touch Joystick stuck
« Reply #5 on: January 13, 2014, 09:41:23 PM »
So do you think this is easy to solve??

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #6 on: January 13, 2014, 11:23:37 PM »
Yes, can you add this new line virtualJoystick=false under joystickIndex=-1;


Code: [Select]
if (EasyTouch.GetTouchCount () == 0) {
    joystickIndex = -1;
    virtualJoystick=false;
}

And tell me, if it fixe

Nicolas

Offline Hazneliel

  • Newbie
  • *
  • Posts: 6
Re: Easy Touch Joystick stuck
« Reply #7 on: January 14, 2014, 06:12:35 AM »
It seems the bug is corrected with this, Thank you very much.
Do you know why is this happening and if this is the right way to correct it??

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #8 on: January 14, 2014, 12:32:14 PM »
It seems that Touch_Up messages may not be properly interpreted by Unity.

So this correction validates the fact that there are no active touches.

Now the correct code is :

if (EasyTouch.GetTouchCount () == 0) {
    joystickIndex = -1;
   
   if (dynamicJoystick){
          virtualJoystick=false;
   }
}

Offline Hazneliel

  • Newbie
  • *
  • Posts: 6
Re: Easy Touch Joystick stuck
« Reply #9 on: January 25, 2014, 08:46:12 PM »
Thank you Nicolas for your answer, I have applied the correction but now I have some errors on console:

NullReferenceException: Object reference not set to an instance of an object
EasyTouch.GetTouchCount () (at Assets/EasyTouch/Plugins/EasyTouch.cs:1604)
EasyJoystick.UpdateJoystick () (at Assets/EasyTouch/Plugins/EasyJoystick.cs:850)
EasyJoystick.Update () (at Assets/EasyTouch/Plugins/EasyJoystick.cs:838)

This started to happen after I applied the correction.

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #10 on: January 26, 2014, 09:25:17 PM »
Hi, can you update your EasyToych with the last version on Asset store.

Nicolas

Offline Astus

  • Newbie
  • *
  • Posts: 3
Re: Easy Touch Joystick stuck
« Reply #11 on: August 16, 2015, 01:43:01 PM »
Hi!
Have the same problem, EasyTouch randomly stuck and randomly un-stuck, in GameView after play and after building, on the end device. Tried re-create ET in scene, tried new scene - all the same. Fun fact - previous versions on Unity 4 all worked perfectly out-the-box. Problems start from version for Unity 5.
Can you please help me with this issue? Easy Touch - awesome tool, but this issue really annoying.
Regards

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Easy Touch Joystick stuck
« Reply #12 on: August 16, 2015, 05:03:21 PM »
Hi Astus,

Since this is an old post, and it is about EasyTouch 3.X, I prefer you ask the question :

Do you have  this problem with EasyTouch EasyTouch 3.X or 4.X?