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 /
This question was closed Oct 23, 2013 at 01:14 AM by meat5000 for the following reason:

The question is self answered

avatar image
0
Question by brandon199511 · Aug 18, 2011 at 01:30 PM · bce0005unknown-identifier

Unknown Identifier?

How is that possible? Line: 35 Unknown Identifier "scriptCircles"

 // Player Script
 
 // Inspector Variables
 var tagName : String;                        //allow the designer to setup a tag in the inspector
 var rayDistance : float = 0;                //length of the ray for out raycast
 var score : int = 0;                            //score for our player
 var gameTime : float = 5;                  //amount of time the game will last
 var loadWaitTime : float = 3.0;
 var numberOfPointsToWin : int = 5;    //amount of points needed to win
 
 // Private Variables
 
 // 
 function Start()
 {
     InvokeRepeating("CountDown", 1.0, 1.0);        // Repeat the countdown every second
 }
 // Update is called every frame
 function Update () 
 {
     // use the mouse button to select onGO in the scene
     if (Input.GetMouseButtonDown(0))
     {
         audio.Play();
         var hit : RaycastHit;
         var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);        // get mouse position
         if (Physics.Raycast (ray, hit, rayDistance))
         {
             if (hit.transform.tag == tagName)
             {
                 //var position = Vector3 (Random.Range(-6,6),Random.Range(-4,4),0);        // new random position for the gameObject
                 //hit.transform.position = position;        // move the gameObject to a random position
                 var enemyScript = hit.transform.GetComponent(scriptEnemy);
                 enemyScript.numberOfClicks -= 1;
                 var circlesScript = hit.transform.GetComponent(scriptCircles);
                 circlesScript.numberOfClicks -= 1;
                 if(enemyScript.numberOfClicks == 0)
                 {
                     score += enemyScript.enemyPoints;
                 }
                 //if(circlesScript.numberOfClicks == 0)
                 //{
                 //    score += circlesScript.enemyPoints;
                 //}
             }
         }
     }
 }
 
 function CountDown()
 {
     if (--gameTime == 0)        // subtract from gametime
     {
         CancelInvoke("CountDown");        // cancell the countdown
         //yield WaitForSeconds (loadWaitTime);
         if (score >= numberOfPointsToWin)
         {
             Application.LoadLevel ("sceneScreenWin");
         }
         else
         {
             Application.LoadLevel ("sceneScreenLose");
         }
     }
 }
 //
 function OnGUI()
 {
     GUI.Label (Rect(10,10,100,20), "Score: " + score);
     GUI.Label (Rect(10,25,100,35), "Time: " + gameTime);
 }
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 CHPedersen · Aug 18, 2011 at 01:35 PM 0
Share

It's possible because there is no script in your project called scriptCircles, and you're trying to use the generic version of GetComponent with that typename as its argument.

avatar image brandon199511 · Aug 18, 2011 at 01:39 PM 0
Share

I got it from my online course. The "scriptEnemy" works fine, and there is a script named "scriptCircles"

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by brandon199511 · Aug 18, 2011 at 01:51 PM

Fixed it by rebooting my pc.

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 CHPedersen · Aug 18, 2011 at 01:53 PM 0
Share

That's strange. O_O But good. :)

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

BCE0005: Unknown identifier 1 Answer

Why Unknown identifier? 1 Answer

'Unknown Identifier' - cannot recognize other scripts 1 Answer

Problem with animation code or blender? 1 Answer

Script won't run level (platformer tutorial) 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