Converting a 3D movement into a 2D

I am still relatively new to unity2D and have a script that I made accidentally using coding from unity3D. I was wondering if you could just help me out with converting it. The script is designed to launch a projectile and into a 2D forward direction and after a little bit explode. Here is the script.

var BulletSpeed = 5;
static var explosion = false;
function Start () {

explosion = false;

}

function Update () {

transform.Translate(Vector3.forward * BulletSpeed);

}
function attackcooldown () {

for (var x = 1; x < 2; x++) {
yield WaitForSeconds(4);

explosion = true;

}
for (var y = 1; y < 2; y++) {
yield WaitForSeconds(1);
//animation would go here
Destroy(gameObject);

}
}

I think you can change Translate for your 2D coords. Like, if you’re playing in X Y coords and you don’t need Z:

function Update () {
 
transform.Translate(Vector3.right * BulletSpeed, Space.World);
 
}

You can use your code in case if your game in Z Y coords.

Hope it’ll help