- Home /
How to reference compound colliders?
Can we just say GetComponent(Collider)? or do we have to iterate all the children? Wondering if the compound colliders are truly treated as one.
Answer by Cherno · Jan 05, 2016 at 11:06 PM
You have to use GetComponents and iterate through the array. So-called Compound colliders don't exist as such in Unity AFAIK, the program treats a gameobject with one collider the same as one with multiple colliders, that is to say, it's the colliders themselves that count, not how many "siblings" they have on the same gameobject.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Variables from one script to another. 3 Answers
acting on other object during collision: SendMessage or GetComponent? 1 Answer
Sound plays right at the beginning 2 Answers