BCE0005 error. Help Please

Hi. I’m learning to se unity and i’m making a little game to test, but i’m not really god at programing and i got this “BCE0005:Uknown Identifier:offsetZ” error when i make a javascript with this code:

public var enemy : Rigidbody; private
var tick : float = 0; public var
speed : float = 5; public var paso :
float = 1;

function Update () {

tick+= Time.deltaTime; speed =
Random.Range(0.0f, 5.0f); offsetZ =
Random.Range(-4.0f, 4.0f); offsetY =
Random.Range(-3.0f, 3.0f);

if (tick>=paso){ tick = 0; var
position : Vector3 = new
Vector3(transform.position.x,
transform.position.y+offsetY,
transform.position.z+offsetZ); var
instantiatedProjectile : Rigidbody =
Instantiate(enemy, position,
transform.rotation);
instantiatedProjectile.velocity =
transform.TransformDirection(Vector3(0,-speed,0));
} }

As i said i’m not really god at programing and if someone could help with this it would be really appreciated.

You’re trying to use a variable called offsetZ without declaring it, so the script has no idea what you’re trying to do. Put this with your other variables:

public var offsetZ : float;

If what you posted is the entire script, then you’ll probably have to do the same for your “offsetY” variable.