Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 monty · Apr 20, 2011 at 12:45 PM · debugsyntax-errorbce0043unexpected-token

unexpected token

what does it mean when it says there is an unexpected token in a script like:

unexpected token: camera

unexpected token: strict

unexpected token: implicit

can anyone help with this cos i need the script for my homework and only have a few days left to complete it. thanx

here is the script

camera: main#pragma strict

pragma implicit

pragma ;downcast;

/code>

another problem on a different script it

expecting } found ;. ( character 22)

and here is the line of code with the problem but i cant find where to put the } cos every where creates more problems with it.

public var camera; ;: main; camera;

thanx again for any help

Comment
Add comment · Show 3
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 monty · Apr 20, 2011 at 01:01 PM 0
Share

i have managed to get these problems to go away now by having 'camera: main' ins$$anonymous$$d of main camera but it now says it wants eof ins$$anonymous$$d of camera does anyone know what that means and how to solve it?

avatar image AngryOldMan · Apr 20, 2011 at 01:17 PM 0
Share

duplicate of http://answers.unity3d.com/questions/52341/cant-debug-this-script

avatar image AngryOldMan · Apr 20, 2011 at 02:36 PM 0
Share

check updated answer

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by AngryOldMan · Apr 20, 2011 at 01:29 PM

unexpected token: camera means you have the word camera in there and your not using it properly. look at the camera script reference you should spot your problem straight away.

  #pragma strict
  #pragma implicit
  #pragma downcast

dont need to be in your script unless your optomising it for online play and they should be at the very top of the page.

an eof is an end of function which is this } character you put it at the end of functions!

//example

function Start() { DoSomething(); }

function DoSomething() { if (SomethingHasNotBeenDone) { Debug.Log ("Do Something Else"); } }

ignore the meaning of the words and look at how the eof is used, there is always a start of function and end of function just like you would use sentances and paragraphs in literary English

EDIT

if you are finding errors asking for eofs and there are already ones there it means the syntax for the previopus line is incomplete, have a look at the line above and check that the parametres you have put in match the ones on the script reference for it

Comment
Add comment · Show 2 · 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 monty · Apr 20, 2011 at 01:37 PM 0
Share

this is the top of the page and camera is the first word but it is saying it needs eof. thanx for the help btw it was really helpful

avatar image monty · Apr 20, 2011 at 01:41 PM 0
Share

i have deleted those things now cos this isnt designed for online but nod it says i need ;'s in places where there are already some there

avatar image
0

Answer by Jesse Anders · Apr 20, 2011 at 01:13 PM

It sounds like there's a simple parsing error in your script (e.g. a mismatched brace). If you need more specific help than that, edit your post to include the script that's generating the error.

Comment
Add comment · Show 1 · 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 AngryOldMan · Apr 20, 2011 at 01:17 PM 0
Share

duplicate of http://answers.unity3d.com/questions/52341/cant-debug-this-script

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

No one has followed this question yet.

Related Questions

Converted a script from C# to JS, Unexpected Token: .. What did I do? 1 Answer

Unexpected Token }. 1 Answer

what is an unexpected token 1 Answer

Unexpected token: .. 1 Answer

Unexpected Token: Collider. 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