GetComponents<>? Getting Multiple Of Same Class On Same Object

Hi there,
I have a third-party, art asset, it has multiple MeshColliders on it. I want my code to get all the Mesh Collider components on this single GameObject, but am unsure how to run that.

Any tips?

Doesn’t GetComponents work? Unity - Scripting API: GameObject.GetComponents

3 Likes

Uhm, so what’s the issue with using GetComponents<MeshCollider>()? It returns all components of that type that are attached to this gameobject.

2 Likes

Sweet! I had no idea!
Thank you

1 Like