how to make a 2d character jump in unity code example
Example 1: unity 2d jump
rigidbody2D.AddForce(new Vector2(0, 10), ForceMode2D.Impulse);
Example 2: how to move a 2d character in unity
if (moveInput != 0)
{
velocity.x = Mathf.MoveTowards(velocity.x, speed * moveInput, walkAcceleration * Time.deltaTime);
}
else
{
velocity.x = Mathf.MoveTowards(velocity.x, 0, groundDeceleration * Time.deltaTime);
}