I am looking for all objects in a hierarchy that have meshes. This includes the object itself and any of its children. The purpose is to attach a mesh effect.
If I use:
It finds the first mesh and works fine. But as I want to have all meshes I am trying the following:
This doesnt find any meshes and I am completely confused to why.
asked Nov 06 '11 at 12:52 PM
Ok, I've found my own answer. I put the result of the find straight into the for loop. I have no idea why it didnt work when the result in an array but the following works a treat:
answered Nov 06 '11 at 02:06 PM
Is it even getting to the for loop? It's possible that you can't cast a MeshFilter to a boolean, and so
always returns false! Try
instead, see if that works any better.
answered Nov 06 '11 at 01:20 PM