scripting problem with 3D Platform Game tutorial

OK, I’m a rank newbie here (my background is modeling and animation), so it’s probably safe to say the I’m being an idiot here, and my problem is really simple.

I’m doing the 3D Platform tutorial, and I’m at the end, at the cut scenes portion. I’ve got two scripts that apparently won’t compile. When I try to add the HandleSpaceshipCollision script to the spaceship, I get the error message: “Can’t add script behaviour HandleSpaceshipCollision. You need to fix all compile errors in all scripts first!” The LevelStatus script doesn’t reflect all of the additional variables that were added; the only one that shows up is the original “Items Needed” variable. I’m guessing that this is also a compiling error.

So…here’s the HandleSpaceshipCollision script:

private var playerLink : ThirdPersonStatus;

function OnTriggerEnter (col : Collider)
{
playerLink = col.GetComponent(ThirdPersonStatus);

if (!playerLink) // not the player.
{
return;
}
else
{
playerLink.LevelCompleted();
}
}

I copied this right out of the tutorial (cut paste) so I’m not sure what’s wrong, or why.

I’ll put the LevelStatus script in the next post so that they’re separate.

Thanks.

Here’s the LevelStatus script:

// LevelStatus: Master level state machine script.

// This is where info like the number of items the player must collect in order to complete the level lives.

var itemsNeeded: int = 20; // This is how many fuel canisters the player must collect.

var exitGateway: GameObject;
var levelGoal: GameObject;

var unlockedSound: AudioClip;
var levelCompleteSound: AudioClip;

var mainCamera: GameObject;
var unlockedCamera: GameObject;
var levelCompletedCamera: GameObject;

// Awake(): Called by Unity when the script has loaded.
// We use this function to initialise our link to the Lerpz GameObject.
function Awake()

levelGoal.GetComponent(MeshCollider).isTrigger = false;

{
playerLink = GameObject.Find(“Player”);

if (!playerLink)
Debug.Log(“Could not get link to Lerpz”);
}

function UnlockLevelExit()
{
mainCamera.GetComponent(AudioListener).enabled = false;
unlockedCamera.active = true;
unlockedCamera.GetComponent(AudioListener).enabled = true;
exitGateway.GetComponent(AudioSource).Stop();

if (unlockedSound)
{
AudioSource.PlayClipAtPoint(unlockedSound,
unlockedCamera.GetComponent(Transform).position, 2.0);
}

yield WaitForSeconds(1);
exitGateway.active = false; // … the fence goes down briefly…
yield WaitForSeconds(0.2); //… pause for a fraction of a second…
exitGateway.active = true; //… now the fence flashes back on again…
yield WaitForSeconds(0.2); //… another brief pause before…
exitGateway.active = false; //… the fence finally goes down forever!

levelGoal.GetComponent(MeshCollider).isTrigger = true;

yield WaitForSeconds(4); // give the player time to see the result.
// swap the cameras back.
unlockedCamera.active = false; // this lets the NearCamera get the screen all to
itself.
unlockedCamera.GetComponent(AudioListener).enabled = false;
mainCamera.GetComponent(AudioListener).enabled = true;
}

Again, I copied this right out of the tutorial (cut paste). The console gives the following info:

Assets/Scripts/Misc/LevelStatus.js(25,20): BCE0044: expecting :, found ‘=’.

Assets/Scripts/Misc/LevelStatus.js(22,1): BCE0043: Unexpected token: levelGoal.

Any help would be appreciated. I’m so close to the end of the tutorial, I’d really like to wrap it up and see how the game plays.

Thanks

OK, well…never mind. I got it figured out.

Thanks.