How to get rigidbody to fall straight down?

Hello, I am making a 2D platformer similar to Mario. The player sprite has a 2D rigidbody component attached and it works perfectly except for when the player is falling. When the player falls it is not just straight down. The player moves forward then stops then starts moving backwards and starts picking up momentum as if more force is being added to the rigidbody in the opposite direction. This occurs even when there is no input. Basically the player falls in a circular motion. How can I get the player to fall straight down? Sorry this is my first forum post so it may be messy and wrong. Here is my code. for jumping

private void Jump()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (grounded == true)
            {
                playerRb.AddForce(Vector2.up * jumpHeight, ForceMode2D.Impulse);
                animator.SetBool("jump", true);
                grounded = false;
                Debug.Log("Jump");
            }

            else if (grounded == false && dJump == true)
            {
                playerRb.AddForce(Vector2.up * jumpHeight, ForceMode2D.Impulse);
                animator.SetBool("jump", true);
                dJump = false;
            }

    }`

And here is my code for movement

    private void MovePhysics()
        {
            var speedFactor = (maxSpeed - playerRb.velocity.magnitude) / maxSpeed;
            var force = new Vector2(1 * horizontalInput, 0);
    
            if (horizontalInput > 0)
            {
                transform.localScale = new Vector3(1, 1, 1);
                //playerRb.AddForce(new Vector2(1 * horizontalInput, 0), ForceMode2D.Impulse);
                playerRb.AddForce(force * speedFactor, ForceMode2D.Impulse);
                animator.SetBool("moving", true);
            }
    
            else if (horizontalInput < 0)
            {
                transform.localScale = new Vector3(-1, 1, 1);
                playerRb.AddForce(force * speedFactor, ForceMode2D.Impulse);
                animator.SetBool("moving", true);
            }
    
            else
            {
                animator.SetBool("moving", false);
            }
    
        }

In Unity3D, you need rigidbodies on GameObjects that use colliders, as they use physics. You don’t need rigidbodies on static GameObjects because they don’t use physics, though you still need to have at least one in the calculation.
Conduent Connect Login