Object Teleporting when moving

I’m trying to make a character controller and when the character moves it stutters a bit along the x axis and looks like it’s teleporting.
The rigidbody2D and box collider all have default settings (z rotation is constrained though)

This is my movescript

{
    public Rigidbody2D rb;
    public float speed = 5000f;
    public float stop = 0f;


    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey("d"))
        {
            rb.velocity = transform.right * speed * Time.deltaTime;
        }

        if (Input.GetKeyUp("d"))
        {
            rb.velocity = transform.right * stop;
        }

        if (Input.GetKey("a"))
        {
            rb.velocity = transform.right * -speed * Time.deltaTime;
        }

        if (Input.GetKeyUp("a"))
        {
            rb.velocity = transform.right * stop;
        }

    }
}

Ignoring the fact that physics by default doesn’t run per-frame yet you’re changing the velocity per-frame, you seem to have a fundamental misunderstanding on what velocity is.

You’re changing it to an absolute value (not accelerating or decelerating) yet you’re scaling it by the elapsed time. That isn’t useful and you don’t need to do it. If you were adding/subtracting from velocity then you’d scale that by the elapsed time.

Note that setting the velocity directly will mean nothing else that interacts with it will be able to change the velocity, not collisions nor gravity for instance.

my solution to this was to have multiple 2D vectors and then add them all up each frame to set the velocity for my main character

 MainRigidBody.velocity = (currentMovementVector + currentKnockback + (new Vector2(0, MainRigidBody.velocity.y)));