Hi,
This may be a weird/interesting question. I’m currently working on a 2D, side scrolling, endless running game. Current touch input accounts for the following:
tap - jump
swipe right - speed boost
swipe down - drop to platform below
I’ve coded it so that my character can also do variable height jumping - meaning the longer the touch is held, the higher the character jumps - so I set the character to jump on touchphase.began.
Well the issues start when the player swipes right - the character will jump first, then dash (which makes sense since I’m also setting the character to jump on TouchPhase.Began. The best I’ve been able to do is cancel as much of the initial jump as possible by setting the rigidbody velocity to zero, then executing my dash code - but it looks awkward.
Any thoughts on how to approach this? I can’t do tap detection on TouchPhase.End because the character won’t jump until the player lifts their finger off the screen.
I’ve tried TouchPhase.stationary, but it’s pretty iffy.
Any other thoughts?
Thanks in advance.