Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Ampler Games · Sep 19, 2011 at 09:14 AM · lerpz

LERPZ levelstatus js error. ??????????

Hey everyone, I am having something strange happening with the Lerpz tut. I copied the level status script from the index thing at the end of the tut and when ever I press play for some reason it stops the game and comes up with this in the debug console...

Assets/Scripts/Misc/LevelStatus.js(10,13): UCE0001: ';' expected. Insert a semicolon at the end.

Assets/Scripts/Misc/LevelStatus.js(10,19): UCE0001: ';' expected. Insert a semicolon at the end.

Assets/Scripts/Misc/LevelStatus.js(10,25): BCE0043: Unexpected token: ..

Assets/Scripts/Misc/LevelStatus.js(10,26): UCE0001: ';' expected. Insert a semicolon at the end.

I have tried several things to try and get this to work but with little success. Here is the Java script code if some one could help me with this.

 // LevelStatus: Master level state machine script.

var exitGateway: GameObject;

var levelGoal: GameObject;

var unlockedSound: AudioClip;

var levelCompleteSound: AudioClip;

var mainCamera: GameObject;

var unlockedCamera: GameObject;

var levelCompletedCamera: GameObject; // 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. private var playerLink: 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");

levelGoal.GetComponent(MeshCollider).isTrigger = false; // make very sure of this! }

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; }

function LevelCompleted() {

mainCamera.GetComponent(AudioListener).enabled = false;

levelCompletedCamera.active = true;

levelCompletedCamera.GetComponent(AudioListener).enabled = true;

playerLink.GetComponent(ThirdPersonController).SendMessage("HidePlayer");

playerLink.transform.position+=Vector3.up*500.0; // just move him 500 units if (levelCompleteSound) {

AudioSource.PlayClipAtPoint(levelCompleteSound, levelGoal.transform.position, 2.0); }

levelGoal.animation.Play();

yield WaitForSeconds (levelGoal.animation.clip.length);

Application.LoadLevel("GameOver"); //...just show the Game Over sequence. }

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ampler Games · Sep 19, 2011 at 09:29 AM 0
Share

Is anyone else having this problem?

avatar image Ampler Games · Sep 21, 2011 at 12:30 AM 0
Share

PLEASE HELP!

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Design3.com · Sep 21, 2011 at 02:15 AM

Can you edit the question so all of the code text is formatted as code? It's hard to read end-to-end like that.

That error means there's a syntax issue somewhere, like a missing semicolon, bracket, or parenthesis.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ampler Games · Oct 27, 2011 at 09:43 PM 0
Share

I have tried looking for that, but I can't find it anywhere! ps.. shouldn't this script be 100% correct if it was posted as one of the main tuts for the unity site? or is there posibly something in my game that I have stuffed up that is stoping this from working?

avatar image Graham-Dunnett ♦♦ · Oct 27, 2011 at 09:47 PM 1
Share

Thousands of people have used this tutorial, so my guess is that you have made a mistake somewhere.

avatar image Ampler Games · Oct 27, 2011 at 10:02 PM 0
Share

Thanks, I will just repeat the tutorial. It shouldn't take me too long.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Procedural Generated 2D Levels 1 Answer

Network Multiplayer 0 Answers

Counting number of blocks in an area 1 Answer

Converting this JS code to C# 1 Answer

How to do isometric camera 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges