Need help I got BCE0005 Error need help asap please newbie here..

Hello guys i just want to Post my script cause im lost now i dont know what the error still cause ive done anything and more but still the same i need some help guys pleasee help me Thankyou Newbie only just need HELP …
ERROR >>> Assets/Acid.js(53,13): BCE0005: Unknown identifier: ‘Lives’.
ERROR >> Assets/Acid.js(55,5): BCE0005: Unknown identifier: ‘RemovalGrime’.

//Acid.js


#pragma strict


var acid:Rigidbody2D;


var speed:float = -3.0;

function Start ()
{

}

function Update ()
{

}

InvokeRepeating("SpawnAcid", 3, 5);

function SpawnAcid()
{
var acidInstance:Rigidbody2D;

acidInstance = Instantiate(acid, Vector3(Random.Range(-8, 8),7,0), Quaternion.Euler(new Vector3(0,0,0)));
acidInstance.name = "Acid(Clone)";
acidInstance.velocity = new Vector2(0, speed);

}

function OnCollisionEnter2D(other:Collision2D)
{

    if(other.gameObject.name=="Spongy")
    {
        Destroy(gameObject);
        RemovalAcid();
    }
   }

   var gameObjects : GameObject[];
function RemovalAcid()
{

    gameObjects =  GameObject.FindGameObjectsWithTag("Acid");

    for(var i = 0 ; i < gameObjects.length ; i ++)
        Destroy(gameObjects[i]);
}
        if (Lives == 0)
    {
    RemovalGrime();
    RemovalAcid();
    Time.timeScale = 0;
}

You’re trying to use variables (like Lives) that don’t exist. You never declared them or set an initial value for them. The RemovalGrime() function also doesn’t exist.

You should also know that UnityScript (Javascript) is horrifically outdated at this point, and you really should be using C#. It’s going to be difficult for you to get help in JS because everyone else is using C#. Plus, any tutorial you are following that tells you to use Javascript is guaranteed to be many years out of date. And to be frank, Javascript has a much higher ratio of newbies to pros, so even what little community there is left that uses JS is going to be much less helpful than the community available to help you with C#.

1 Like

JS (UnityScript) is deprecated in Unity, is not guaranteed to work anymore, and if you are new to Unity your first task you should take on should be learning C#.