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 Jett Dela Cruz · Jul 31, 2013 at 08:46 PM · getcomponentpathfinding

AI Pathfinding BCE0019: 'GetComponent' is not a member of 'Object'.

I'm developing a map for pathfinding AI in my mobile game, and i'm really getting confused to fix this error " BCE0019: 'GetComponent' is not a member of 'Object'. " it works fine in PC, Mac & Linux development build but i keep on getting errors when i'm running it in an android development build. can someone pls help me, i've tried everything but i can't really fix it. here's the code:

   for (stage = 2; stage <= cells.length; stage++)
             {
                 for (i = 0; i <= cells.length - 1; i++)
                 {
                     if (doorsToCells[i] == stage - 1)
                         for (var checkDoor : GameObject in cells[i].GetComponent(AIpathCellScript).doors)
                         {
                             if (checkDoor != gameObject)
                             {
                                 for (var checkCell : GameObject in checkDoor.GetComponent(AIpathDoorScript).imediateCells)
                                 {
                                     for (var j : int = 0; j <= cells.length - 1; j++)
                                     {
                                         if (cells[j] == checkCell && doorsToCells[j] == null)
                                             doorsToCells[j] = stage;
                                     }
                                 }
                             }
                         }
                 }
             }
                
            
             testForCells = false;
         }
         waitToTestCells -= 1;
     }

please help :(

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 Graham-Dunnett ♦♦ · Jul 31, 2013 at 08:47 PM 0
Share

When asking for help with script errors it's really really really good form to post the line number where the compiler found the error. Otherwise us guys have to read the code line by line trying to see what the compiler sees.

avatar image Graham-Dunnett ♦♦ · Jul 31, 2013 at 08:47 PM 0
Share

What is the type for the cells array. $$anonymous$$aybe it's untyped?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Xtro · Jul 31, 2013 at 08:57 PM

If you store gameobjects in the array, you should cast cells[i] to GameObject

((GameObject)cells[i]).GetComponent(.......);

if your cells array is storing unity component objects then you should cast accordingly

((Component)cells[i]).GetComponent(.......);

I don't know what type is your cells array.

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 Xtro · Aug 08, 2013 at 07:28 PM 0
Share

Did it help you out ?

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

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Plese help me guys! BCE0019: 'GetComponent' is not a member of 'Object'. 1 Answer

My question is how to give a newly made prefab a location target. 2 Answers

What path-finding technique do I use? 2 Answers

Alternative to remainingDistance (Entire Path Calculation)? 0 Answers

Path finding algorithm for 2d game 2 Answers


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