Gestures with unscaled time

Got a good idea for TouchScript? Post it here.

Gestures with unscaled time

Postby ipsus » Mon Jul 03, 2017 10:07 pm

I'm stuck with a simple use case: process gestures while the game is paused (Time.timeScale = 0). Changing Time.time to Time.realtimeSinceStartup in Gesture does not do the trick (who was ever doubted that it could?).
ipsus
 
Posts: 9
Joined: Mon Apr 17, 2017 1:13 am

Re: Gestures with unscaled time

Postby valyard » Thu Jul 20, 2017 11:37 pm

What gestures are you trying to use?
I'll check the system to see how it works with timeScale = 0, I think some gestures have already been updated earlier.
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: Gestures with unscaled time

Postby ipsus » Tue Jul 25, 2017 8:18 pm

Basically one of the simplest - FlickGesture. I'm trying to rely on the sign of gesture.ScreenFlickVector.x and decide where to move my carousel - to the left or to the right.
ipsus
 
Posts: 9
Joined: Mon Apr 17, 2017 1:13 am

Re: Gestures with unscaled time

Postby valyard » Wed Jul 26, 2017 10:09 am

I believe I made all gestures work with unscaledTime. I'm releasing 9.0 soon, try with the new version please.
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: Gestures with unscaled time

Postby ipsus » Wed Jul 26, 2017 1:59 pm

Previously I was using TouchScript 9 alpha 2, now upgraded to alpha 3 with the same behaviour.
I made a flick event handler like this:
Code: Select all
        private void OnFlicked(object sender, EventArgs eventArgs)
        {
            var gesture = (FlickGesture)sender;
            Debug.Log("Flicked " + gesture.ScreenFlickVector.x);
        }

Now when I run the game with Time.timeScale=1 and make 3 flicks from left to right and then 3 flicks from right to left I get the following output:
Flicked 796
Flicked 465
Flicked 737
Flicked -494
Flicked -504
Flicked -619

When I set Time.timeScale=0 and do the same sequence of flicks I get the following output (clean run that does not interfere with the previous experiment):
Flicked -1133
Flicked -530
Flicked -46
Flicked -622
Flicked -1385
Flicked -1889

So in the latter case gesture.ScreenFlickVector.x seems to accumulate deltas in some way or another.
ipsus
 
Posts: 9
Joined: Mon Apr 17, 2017 1:13 am

Re: Gestures with unscaled time

Postby valyard » Wed Jul 26, 2017 3:43 pm

Could you please try your script with this version?
https://www.dropbox.com/s/424n3to0z5qtn ... 7.zip?dl=0
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: Gestures with unscaled time

Postby ipsus » Wed Jul 26, 2017 6:19 pm

Unfortunately, the behaviour is the same as with 9a3.
ipsus
 
Posts: 9
Joined: Mon Apr 17, 2017 1:13 am

Re: Gestures with unscaled time

Postby valyard » Sat Jul 29, 2017 11:10 am

Alright, seems to be fixed now.
Will publish the next version soon.
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: Gestures with unscaled time

Postby valyard » Sun Jul 30, 2017 3:56 pm

valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: Gestures with unscaled time

Postby ipsus » Tue Aug 01, 2017 4:04 pm

Thanks a lot for the update - the behavior has been fixed indeed and become as intended.
ipsus
 
Posts: 9
Joined: Mon Apr 17, 2017 1:13 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest