I am working on a metrovania style game and I identify touch areas for left-right movements and jump. The problem is; For example I am moving right and at the same time I jump, It works perfectly but when I release jump it also cancels the movement to the right. Is there anyway to continue Input.GetTouch(0) after releasing Input.GetTouch(1) ?
Thanks in advance
Input.multiTouchEnabled = true;
if (Input.touchCount > 0)
{
for ( int i = 0 ; i < tapCount ; i++ ) {
Touch touch = Input.GetTouch(i);
switch (touch.phase) {
case TouchPhase.Began:
if (touch.position.x < Screen.width /6 && touch.position.y < Screen.height / 4 && ){
rb.velocity = new Vector2 (- moveSpeed , rb.velocity.y);
else if (touch.position.x > Screen.width /6 && touch.position.x < Screen.width /3 && touch.position.y < Screen.height / 4 ) {
rb.velocity = new Vector2 (moveSpeed , rb.velocity.y);
else if (touch.position.x > Screen.width * 5/6 && touch.position.y < Screen.height / 4 && grounded == true ) {
rb.AddForce(new Vector2(0, jumpForce));