Touch and Swipe Behavior
-
I have a started touching behavior that makes my player jump, all is good. I added a swiping behavior to make the player attack. The start touching behavior always fires first… so when I swipe the jump logic fires before the attack logic. Cannot figure out how to differentiate between touches and swipes. Any pointers would be appreciated!
-
I think I figured out, used a wait behavior after the touch and checking a couple of player action state variables.
-
Not a solution, with a wait it still randomly triggers the touch before the swipe. HELP! This has to be easy…
-
In general using swipe and touch will conflict because the initial gesture is the same.
Try using stopped touched instead. Usually you want to initiate an action when you let go of a button any ways.
-
@Murtaza I will try that; however, from my days as an in-house tester at Nintendo, button down or touch begin initiates an action. With application interfaces button up or touch end seems to be the case… ah the nuances of UI/UX .
-
@Murtaza Didn’t work… The end of a swipe triggers stopped touching.
-
@krdavis
You could try disabling the behaviour, then when you're done touching enable it. -
@Murtaza still wonking behavior, thx… I’ll keep messing with it.
-
@Murtaza short swipes were the problem, they were acting like a touch. The player needs to make a decent swipe and then all works as expected. I also used stopping touch to initiate a jump, A tap and the player jumps and a long swipe, player attacks. Thanks for pointing me in the right direction.
-
@krdavis
Glad you figured it out!