say i’m starting from a gameobject. I like to do things by walking around the hierarchy. Right now i’m trying to get an object’s mesh. the same mesh is shared by the mesh renderer, and the mesh collider on the object.
I tried gameObject.collider.sharedMesh, but that throws an error, sharedmesh apparently isn’t a property of a collider. It’s a property of a MeshCollider.
so then i tried gameObject.meshCollider.sharedMesh, but that fails too, because meshCollider isn’t a property of gameObject.
the other route doesn’t work either, gameObject.renderer.sharedMesh isn’t a valid property
and of course, neither is gameObject.meshRenderer
is there any way to accomplish this without using getComponent? that feels really unwieldy and annoying to do, and i have this instinctual feeling it’s slow, too. not tested that hypothesis though.