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);
}
}