Player Shoots Wrong

For some reason when I shoot right everything works well, but when I shoot left the bullets move down and push me
Video:
2023-03-14 18-04-07.mp4 - Google Drive
Code:

using UnityEngine;

public class gunShoot : MonoBehaviour
{

    public Transform firePointR;
    public Transform firePointL;
    public GameObject bulletPrefab;
    public flipSprite flipSprite;

    public float bulletForce = 20f;


    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            Shoot();
        }
    }

    void Shoot()
    {
       
        if (flipSprite.spriteIsFlipped)
        {
            GameObject bullet = Instantiate(bulletPrefab, firePointL.position, firePointL.rotation);
            Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
            rb.AddForce(firePointR.right * bulletForce, ForceMode2D.Impulse);
        }
        else
        {
            GameObject bullet = Instantiate(bulletPrefab, firePointR.position, firePointR.rotation);
            Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
            rb.AddForce(firePointR.right * bulletForce, ForceMode2D.Impulse);
        }
       
    }
}

Does anyone know how to solve this? Please let me know.

Because of how your weapon is positioned, when you shoot to the right the barrel is far enough away from your player’s body so that the bullets don’t collide with him. When you shoot to the left, though, your barrel is much closer to your player’s body, and so every spawned bullet is hitting your player.

One way to fix this would be to put the bullets on a layer that ignores collisions with the player. Another way would be to use Physics2D.IgnoreCollision to tell each newly-spawned bullet to ignore collisions with your player (check out the code example on that page).

thank you it worked:)