Slow drag gesture does not work

Ask for help and post bugs.

Slow drag gesture does not work

Postby elmstrom » Fri Nov 24, 2017 12:12 am

Hello

I am having problem getting transform gesture to work as i want.
I make games for large android touch scrrens, and when dragging slowly, the gesture does not kick in.
I have tried settings min point distance and movement threshold to 0 or 0.01, makes no difference.
Have tried making all gesture friends, makes no difference.

In the Editor i can slow drag with no problem, it is only when i build for android i see the problem.
I can see that android detects the movement (i have touch curser enable), but unity or touchscript does not.

https://www.youtube.com/watch?v=5iwwcCTNHXM <- quick video to show the issue.

And finally thanks for you great great plug in, i use it in every project i make!
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby valyard » Fri Nov 24, 2017 12:32 am

What device is it? I guess, it uses native Android touch API.

Can you open TwoPointTransformGestureBase.cs, add a Debug.Log(dP) somewhere after line 143 with this code:
dP = doOnePointTranslation(getPointPreviousScreenPosition(0), getPointScreenPosition(0), projectionParams);
and see the values of dP
valyard
Site Admin
 
Posts: 434
Joined: Mon Sep 08, 2014 11:57 pm

Re: Slow drag gesture does not work

Postby elmstrom » Fri Nov 24, 2017 9:21 am

The devices are with native android touch
They are like this one: https://www.alibaba.com/product-detail/ ... 0a30m5fFXA - But with android 4.4 or 5.1.1

There is no dP output when i slow drag, only when i hit a certain speed.

I also tried adding degub log in Gesture.cs at line 938

Code: Select all
        protected virtual void pointersUpdated(IList<Pointer> pointers)
{
Debug.Log("pointer moved");   
 }

It is the same nothing in log unless i hit a certain speed.
Last edited by elmstrom on Sat Nov 25, 2017 3:10 am, edited 3 times in total.
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby elmstrom » Fri Nov 24, 2017 9:59 am

Just tried this in update

Code: Select all
        if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
        {
            Debug.Log("touch moved");
        }


Same problem, so it is at unity lvl it goes wrong.

Maybe the problem is here:
https://docs.unity3d.com/ScriptReferenc ... shold.html

Just not sure how to disenable that threshold.
Last edited by elmstrom on Sat Nov 25, 2017 3:09 am, edited 1 time in total.
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby elmstrom » Sat Nov 25, 2017 3:09 am

Another small test

Just read the input.touch to see if unity sees that the point has moved.

Code: Select all
        foreach (Touch touch in Input.touches)
        {
            Debug.Log(touch.position);
        }


no matter how slow i move, the coordinates changes. So it is not a driver or hardware issue, unity does see that the touch point is moved, it just does not trigger the drag/TouchPhase.Moved.
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby valyard » Mon Nov 27, 2017 11:11 pm

Wait, so touch.position changes but touch.phase is not equal to TouchPhase.Moved?
valyard
Site Admin
 
Posts: 434
Joined: Mon Sep 08, 2014 11:57 pm

Re: Slow drag gesture does not work

Postby elmstrom » Tue Nov 28, 2017 8:54 am

Yes, touch.position changes. I am not sure about touch.phase (have not looked at that).


touch.position changes, no matter how slow i drag, but TouchPhase.Moved does not trigger unless i hit a certain speed. I can slow drag from on side of the screen to the other, without triggering touchphase.Moved. As soon as i speed up it gets trigger and the objects moves to my finger.
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby valyard » Tue Nov 28, 2017 6:57 pm

Could you please make a test project without TouchScript with the code like this
for (var i = 0; i < Input.touchCount; i++)
{
var touch = Input.GetTouch(i);
Debug.Log(touch.position + " " + " " + touch.deltaPosition + " " + touch.phase);
}
And check if you see that position changes while touch phase doesn't.
I don't see a bugreport like this in our database.
valyard
Site Admin
 
Posts: 434
Joined: Mon Sep 08, 2014 11:57 pm

Re: Slow drag gesture does not work

Postby elmstrom » Tue Nov 28, 2017 8:37 pm

Code: Select all
(1472.0, 282.6)  (-0.5, 0.0) Stationary
(1471.3, 282.7)  (-0.7, 0.1) Stationary
(1470.9, 282.7)  (-0.3, 0.0) Stationary


position changes, but touch phase only changes if i move fast enough.

Code: Select all
(1043.2, 323.4)  (-1.7, -0.4) Stationary
(1041.3, 323.0)  (-1.8, -0.4) Moved
(1038.5, 322.4)  (-2.8, -0.6) Stationary
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Re: Slow drag gesture does not work

Postby elmstrom » Tue Nov 28, 2017 9:53 pm

The "tablets" are 24" to 32", so they are running standart android, but on a much larger screen then normal.
elmstrom
 
Posts: 9
Joined: Thu Nov 23, 2017 11:52 pm

Next

Return to Help and Bugs

Who is online

Users browsing this forum: No registered users and 5 guests