whenever i try to build my game to webGL, i get this error:
Assets/Playerrespawn.js(5,5): BCE0005: Unknown identifier: 'clone'.
and i use the clone part in 5 other scripts and i get errors from them all. the scripts worked fine in the editor but it gets an error when i build it. can you please help?
here is one of the codes:
var Explosion : Rigidbody;
function OnCollisionEnter (col : Collision)
{
if(col.gameObject.name == "Plane 1"){
clone = Instantiate(Explosion, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, 0));
transform.position = Vector3(274.7, 10, 444);
}
if(col.gameObject.name == "Virus"){
clone = Instantiate(Explosion, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, 0));
transform.position = Vector3(274.7, 10, 444);
}
if(col.gameObject.name == "InfectedRobot"){
clone = Instantiate(Explosion, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection( Vector3 (0, 0, 0));
transform.position = Vector3(274.7, 10, 444);
}
}
ps. the game is about a robot that destroys a virus.