• 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 Andrew 5 · Aug 06, 2010 at 12:19 AM · iphonebce0005unknown-identifier

Unknown Identifier?

I have two scripts added to a camera, one of which is my "GameManager" that keeps track of score, etc.

At the top of this GameManager script, I have variables declared like this:

static var score = 0;

In the other script attached to the camera I am trying to access the score variable through GameManager.score, but it simply shows the error "BCE0005: Unknown identifier: 'GameManager'."

I don't understand how that works because I am accessing that score variable just fine through another script that is attached to another object through GameManager.score... Is it because the GameManager script was added after the first script attached to the camera, or am I doing something else wrong?

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 spinaljack · Aug 06, 2010 at 12:33 AM 0
Share

You need to define "Game$$anonymous$$anager" generally you wont call your variables the same names as their type (e.g. var float : float) If your script is called Game$$anonymous$$anager you'd call the variable gm or game$$anonymous$$anager just to make it easier to read.

avatar image Andrew 5 · Aug 06, 2010 at 12:40 AM 0
Share

If I try and define it like var gm : Game$$anonymous$$anager = GameObject.Find("Camera").GetComponent(Game$$anonymous$$anager), the error turns into "Game$$anonymous$$anager does not denote a valid type"...

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by Eric5h5 · Aug 06, 2010 at 12:33 AM

If you're mixing languages, read this: http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html

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 Andrew 5 · Aug 06, 2010 at 12:36 AM 0
Share

It's all Javascript

avatar image Toxic Blob · Aug 27, 2010 at 01:54 AM 0
Share

I had this error while using iTween (a C# script) with my predo$$anonymous$$ately JavaScript project. The solution is as that document states - to put your script to compile last outside the StandardAssets folder.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Unknown Identifier? 1 Answer

Script won't run level (platformer tutorial) 1 Answer

Problem with animation code or blender? 1 Answer

I got a major question 1 Answer

Static variables problem 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