This is probably a very easy fix. I am doing the 3D Platformer tutorial and I have run into a problem. I’m almost done, I’m at the part where you have to make a cut-scene. I did exactly like the tutorial says but when I go to drag and drop my levelStatus.js on to the level I get this error, Script levelStatus has not finished compilation yet. Please wait until compilation is finished. My script also gets this error, Assets/Scripts/Enemies/EnemyPoliceGuy.js(35,25): BCE0018: The name ‘LevelStatus’ does not denote a valid type. And more. What am I to do?
Heres the 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()
{
playerLink = GameObject.Find("Player");
if (!playerLink)
{
Debug.Log("Could not get link to Lerpz");
}
levelGoal.GetComponent(MeshCollider).isTrigger = false;
}
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;
}
[/code]