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*.gameObject.GetComponent(MeshFilter).mesh);*
  • }*

  • for(i=0; i < objMeshList.Count; i++){*
    _ thisObj = objMeshList*;_
    _
    for(theseVectors in thisObj){_
    _
    vertexAll.Add(theseVectors.vertices);_
    _
    normalsAll.Add(theseVectors.normals);_
    _
    }_
    _
    }*_

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.