playMaker

Author Topic: only detect quick swipe not slow long swipe[SOLVED]  (Read 3808 times)

Darkmonk

  • Playmaker Newbie
  • *
  • Posts: 2
only detect quick swipe not slow long swipe[SOLVED]
« on: December 18, 2013, 09:46:56 AM »
hi guys,

Im pretty new to playmaker so not sure if there is a simple answer to this question,
Basically i have 2 different FSMs controlling my character, the first one moves my character around the screen using the Delta X and Y position so as you slide your finger the character moves the same amount as your finger has moved, you can touch anywhere on the screen to do this so you dont have to be touching the character.
The second FSM has a swipe gesture on it to make the character do an alternate motion left or right.
I have it all setup and working although my problem is that if i touch the screen and move my finger to the side slowly moving the character as soon as i lift my finger it detects it as a swipe motion. Is there some way to only accept a swipe motion if your finger has touched and lifted within a timeframe eg. 0.25 seconds ??


« Last Edit: December 18, 2013, 10:37:40 AM by Darkmonk »

Darkmonk

  • Playmaker Newbie
  • *
  • Posts: 2
Re: only detect quick swipe not slow long swipe
« Reply #1 on: December 18, 2013, 10:36:42 AM »
Its OK, i managed to get a solution :)

just in case anyone else wants to know how solved this issue here is what i did.

I used the node Get time info to store the time in a currect state and recorded the time from when you touch the screen and when your finger lifted, I then used a float compare to check to see if you had touched the screen for longer than the compare time and if it was less continue on and swipe if not go back to previous state :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: only detect quick swipe not slow long swipe[SOLVED]
« Reply #2 on: December 19, 2013, 05:01:17 AM »
hi,

Very good! thanks for sharing your findings.

bye,

jean