how to make rigidbody 2d move constantly

I would like for my player character to move constantly without user input like in flappy bird. At the moment this is my code:

void Update()
{
    rb = GetComponent<Rigidbody2D>();
    rb.AddForce(Vector3.right*0.5f);
}

It moves forward constantly but not linearly (it gets faster and faster (I think this is because its in the update() function so it adds the speed up every frame)). I have tried putting my code in void start() but it doesn’t work. I was wondering if anyone knew how to make it so that it moves at a constant speed?

Nevermind I was not thinking, but I figured it out in the end. I used this code in void Update() for anyone that might have the same question.

void Update()
{
    rb = GetComponent<Rigidbody2D>();
    rb.position += Vector2.right * 0.1f;
}

Update method adds force each frame. If you don’t need this, i would suggest you to turn off gravity and drag in inspector and then add force in Start() method which is called once when game starts. So your game would be optimized.

Assigning components in Update method is a wrong way. Do it in Awake method.

public float speed;

private void Awake()
{
        rb.GetComponent<Rigidbody2D>(); //Assign components in awake or start method
}


private void Start()
{
        rb.velocity = vector2.right * speed;
}