Set the velocity of object in direction of player's rotation

So I have this problem that I can’t solve. I want my player to be able to shoot balls but when I set the direction that the ball needs to travel in it adds the velocity, but even after the ball is shot, it still follows the rotation of the player. So how would I be able to make the player travel in the direction of the player when I add the velocity, and then continue in that direction, no matter the rotation of the player after the addition of the velocity.

public class PlayerMovement1 : MonoBehaviour
{
//Global variable for all players
public float bulletSpeed = 3f;
public float sizeIncreaseRate = 0.4f;
public float playerSpeed = 10f;
public float jumpSpeed = 50;
public float recoil = -25;

//Public GameObject variables
public GameObject pivot;
public GameObject bulletEmitter;
public GameObject bullet;

public GameObject bulletInstance;
private Rigidbody rb;
private Rigidbody bulletRB;
private bool isReleased = true;
private bool m_isAxisInUse = false;
private bool inAir = false;
public bool isExpanding = false;
private float bulletSizetoRecoil;
private Vector3 pivotDirection;

//player control variables
private float rTriggerRaw;
private float moveHorizontal;
private float rsVertical;
private float rsHorizontal;
private float rTrigger;
private float xAxis;
private float yAxis;
private float playerNumber;
private bool aButton;

void Start()
{
    //Gets the component of the player's RigidBody
    rb = GetComponent<Rigidbody>();
}

void FixedUpdate()
{
    Vector3 movement = new Vector3(moveHorizontal, rb.velocity.y);
    rb.MovePosition(transform.position + (movement * playerSpeed * Time.deltaTime));
    //Jump when the player presses A 
    if (aButton && inAir == false)
    {
        rb.AddForce(0, jumpSpeed * 2f, 0, ForceMode.Force);
        inAir = true;
    }
    //Controls the aim of the gun depending on the angle of the right joystick
    if (yAxis != 0 || xAxis != 0)
    {
        float joystickAngle = Mathf.Atan2(xAxis, yAxis) * Mathf.Rad2Deg;
        pivot.transform.rotation = Quaternion.Slerp(pivot.transform.rotation, Quaternion.Euler(pivot.transform.rotation.x, pivot.transform.rotation.y, joystickAngle - 90F), Time.deltaTime * 5);
    }
    Shoot();
}

void Update()
{
    if (gameObject.name == "Player 2")
    {
        rTriggerRaw = Input.GetAxisRaw("Right Trigger1");
        moveHorizontal = Input.GetAxis("Horizontal1");
        rsVertical = Input.GetAxis("Mouse Y1");
        rsHorizontal = Input.GetAxis("Mouse X1");
        rTrigger = Input.GetAxis("Right Trigger1");
        aButton = Input.GetButton("A Button1");
        xAxis = Input.GetAxis("Mouse X1");
        yAxis = Input.GetAxis("Mouse Y1");
        playerNumber = 2;
    }
    if (gameObject.name == "Player 1")
    {
        rTriggerRaw = Input.GetAxisRaw("Right Trigger");
        moveHorizontal = Input.GetAxis("Horizontal");
        rsVertical = Input.GetAxis("Mouse Y");
        rsHorizontal = Input.GetAxis("Mouse X");
        rTrigger = Input.GetAxis("Right Trigger");
        aButton = Input.GetButton("A Button");
        xAxis = Input.GetAxis("Mouse X");
        yAxis = Input.GetAxis("Mouse Y");
    }

}
//If thes player touches the ground then the player is no longer in the air
void OnCollisionEnter(Collision ground)
{
    if (ground.collider.tag == "Ground")
    {
        inAir = false;
    }
}

//Names the bullet depending on which player shoots the bullet
void NameBullet()
{
    bulletInstance.gameObject.name = "Bullet " + playerNumber;
}

void Shoot()
{
    if (rTriggerRaw != 0 || Input.GetKeyDown("space"))
    {
        if (m_isAxisInUse == false)
        {
            bullet.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
            bulletInstance = Instantiate(bullet, bulletEmitter.transform.position, pivot.transform.rotation);
            m_isAxisInUse = true;
        }
        bulletInstance.GetComponent<Bullet>().isExpanding = true;
        bulletInstance.transform.localScale += new Vector3(sizeIncreaseRate * Time.deltaTime, sizeIncreaseRate * Time.deltaTime, sizeIncreaseRate * Time.deltaTime);
        bulletSizetoRecoil = bulletInstance.transform.localScale.x * 2f;
        bulletInstance.GetComponent<Bullet>().bulletSizeToKnockBack = bulletInstance.transform.localScale.x * 3;
        if (bulletInstance.transform.localScale.x >= 1.25f || bulletInstance.transform.localScale.y >= 1.25f || bulletInstance.transform.localScale.z >= 1.25f)
        {
            bulletInstance.transform.localScale = new Vector3(1.25f, 1.25f, 1.25f);
        }
        if (m_isAxisInUse == true)
        {
            bulletInstance.transform.position = bulletEmitter.transform.position;
        }
    }
    if (rTriggerRaw == 0 || Input.GetKey("space"))
    {
        if (bulletInstance != null)
        {
            bulletRB = bulletInstance.GetComponent<Rigidbody>();
            if (bulletRB != null)
            {
                isReleased = true;
                if (bulletSizetoRecoil >= 1.1 && isReleased == true)
                {
                    //recoil here
                    isReleased = false;
                }
                bulletInstance.GetComponent<Bullet>().isExpanding = false;
                bulletRB.velocity = bulletInstance.transform.right * bulletSpeed;
                NameBullet();
                m_isAxisInUse = false;
                Destroy(bulletInstance, 2f);
            }
        }
    }
}

}

hello thats probably because your bullet is child of the parent, can you share your code?