How can I make my character constantly run right? Please

private void Update()
{
if(Input.GetKeyDown(KeyCode.UpArrow))
{
if(canJump == true)
{
rigidbody2d.AddForce(new Vector2(1, 500));
canJump = false;
}
}
}

/*

  • If the player has collided with the ground, set the canJump flag so that
  • the player can trigger another jump.
    */
    private void OnCollisionEnter2D(Collision2D other)
    {
    canJump = true;
    }
    }

Declare variables:

public float speed = 4; //Whatever speed you want

In Update:

transform.position += (transform.right * speed) * Time.deltaTime;