Hi, i am making an endless runner 2d game:
When i jump i do this :
jump = true;
anim.SetTrigger("Jump");
// Add a vertical force to the player.
if(Mathf.Abs(rigidbody2D.velocity.y) <= 1)
rigidbody2D.AddForce(new Vector2(0f, jumpForce));
grounded = false;
anim.SetBool("Ground",grounded);
But if i press right arrow i need to stop the y moving of the player, how can i do ?
Thank you