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 /
This question was closed May 25, 2018 at 01:35 AM by bpears for the following reason:

Other

avatar image
0
Question by bpears · Jul 22, 2014 at 06:00 PM · javascripterrorbce0019

BCE0019: 'vertices' is not a member of 'Object'.

I keep getting "BCE0019: 'vertices' is not a member of 'Object'. " error. Not sure whats not quite right.

     for(i=0; i < objChildren.Count; i++){
         objMeshList.Add(objChildren[i].gameObject.GetComponent(MeshFilter).mesh);
     }
     
     
     for(i=0; i < objMeshList.Count; i++){
         thisObj = objMeshList[i];
         for(theseVectors in thisObj){
             vertexAll.Add(theseVectors.vertices);
             normalsAll.Add(theseVectors.normals);
         }
     }

Comment
Add comment · Show 4
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 robertbu · Jul 22, 2014 at 06:11 PM 2
Share

How did you declare theseVectors? $$anonymous$$y guess is that you did:

 var theseVectors;

and you need to do:

 var theseVectors : $$anonymous$$esh;

(assu$$anonymous$$g theseVectors is a mesh).

avatar image bpears · Jul 22, 2014 at 06:21 PM 0
Share

I actually didn't assign it to anything, its just a holder variable. I tried specifying that it is a mesh, like you said, but no luck.#pragma strict is on, but I have other holder variables in other for() loops and it doesnt care about those not being pre defined. I don't understand why Unity thinks my obj$$anonymous$$eshList is a list of Objects?

avatar image robertbu · Jul 22, 2014 at 06:39 PM 1
Share

Are you absolutely sure you have '#pragma strict' as the first line in your file? With #pragma strict, this code should be outputting a slew of errors.

avatar image bpears · Jul 22, 2014 at 07:01 PM 0
Share

yes, this is just the important part of the code, to make reading easier.

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by tanoshimi · Jul 22, 2014 at 06:30 PM

objMeshList is a

 List<mesh>()

, right? (I'm assuming from line 2)

So, if thisObj is an element from this list, it's a mesh, and meshes don't have "theseVectors". So the error is on line 8 - what is "theseVectors", and is objMeshList meant to be a list of whatever sort of class has it?

Basically, your problem lies in relying upon Javascripts dynamic typecasting - a feature that many people think makes Javascript easier, but in most cases ends up being a royal PITA. Always type all your variables, and problems like this should go away.

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 bpears · Jul 22, 2014 at 07:00 PM 0
Share

Thank you, typecasting it fixed that. I see now thats what robertbu was saying also, thought he meant just having the var defined at the top of the script.

Follow this Question

Answers Answers and Comments

22 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Why is this player script not working 1 Answer

UnityEngine.GameObject Error 1 Answer

Semicolon error using JS 1 Answer

rigidbody' is not a member of 'UnityEngine.Object ? 4 Answers

Access JavaScript variables on c# script (Android build fails!) 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