(2D) Player Bullet Only Moves in One Direction

Hello community! I’ve been having a devil of a time with this issue.

I have a GameObject parented to a player that moves on a 2D plane (X-axis, specifically). That GameObject has the following script that is meant to shoot a pellet:

var Pellet : GameObject;
var fireFreq : float;
private var lastShot : float;

function Update (){
	
	if (Input.GetButtonDown("Fire1") && (Time.time > lastShot + fireFreq)){
		PelletSpawn();
	}
}

function PelletSpawn() {
	lastShot = Time.time;
	Instantiate (Pellet, transform.position, transform.rotation);
}

The GameObject I link in this code has a separate code attached to it that makes it move:

var pelletspeed : float;

function Update () {
	transform.Translate(pelletspeed * Time.deltaTime,0,0);
	Destroy(gameObject, 1);
	
}

For the life of me, I can only make the bullet move in one direction. I’ve searched this site for similar issues, but their solutions don’t seem to apply to my problem, but more than likely I’m just missing something obvious.

Any help would be appreciated!

Assuming a 2D with camera facing positive ‘z’:

Instantiate (Pellet, transform.position, Quaternion.Euler(0.0, 0.0, 180.0) * transform.rotation);

If the player is never rotated, then you can leave off the 'transform.rotation at the end:

Instantiate (Pellet, transform.position, Quaternion.Euler(0.0, 0.0, 180.0));

And as an alternate:

Instantiate (Pellet, transform.position, Quaternion.AngleAxis(180.0, Vector3.forward));