Jumping sends me flying backwards

I don’t know why but whenever I press the space bar(Jump) it sends me flying backwards. I am using Rigidbody for my character. Here is the code.

void Update()
    {
        
        transform.rotation = Quaternion.Euler(180, Rotation, 0);
        player.AddForce(7 * Input.GetAxis("Vertical") * Time.deltaTime * transform.right,ForceMode.Impulse);
        Rotation += Input.GetAxis("Mouse X") * 3;

        if (player.velocity.magnitude > 7)
        {
            player.AddForce(-1 * transform.right, ForceMode.Impulse);
        }
    }
    private void Start()
    {
        Physics.gravity = new Vector3(0, -3, 0);
    }
    private void OnCollisionStay(Collision collision)
    {
        player.AddForce(Input.GetAxis("Jump") * new Vector3(0, 7, 0), ForceMode.Impulse);
    }

Hello.

You are adding a force to the platyer, so you just need to check what vector of forceyo uare applying…

7 * Input.GetAxis("Vertical") * Time.deltaTime * transform.right,ForceMode.Impulse

this is a vector. that transform.right is a direction vector, so most probably you have the played turned, so its local "right side is what you are calling backwards.

Take not, all directions fromt he transform component are relative to objects rotation.

Bye.