Can't add script

Hi

I have just started to use Unity, but i have already run into some problems.
I have a script that I want to apply to an empty object, but every time I try to drag and drop the script, I get this message:

Script MissileLauncher has not finished compilation yet. Please wait until compilation of the script has finished and try again.

I hope that some of you know how to solve this problem.

The script:

var projectile : Rigidbody;

var speed = 20;

function Update () {

if (Input.GetButtonDown (“Fire1”)) {

var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position,
transform.rotation);

instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (0,0,speed));

Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);
}
}

Thanks in advance

Akonron

191533–6784–$missilelauncher_672.js (410 Bytes)

do you get that message as an error?

if yes, its because you have an error over another script (probably), so you need to fix that error before you can put it on the GameObject.

what does this mean…

1 Like

It means look at the status bar at the bottom of your Unity window.

Is there red text reporting a script error?

If there is, you have to fix whatever is causing the error.

1 Like

it gives a parsing error, how do i fix that?

i’m still a beginner at scripting :stuck_out_tongue: