- Home /
How can I combine many BoxCollider2D into one Collider?
Hello
I am having problems with Unity Physics because of many box colliders, How can I combine all of them into one collider?
What are they for? Just collisions or are some of them triggers?
Why does it matter? Till now I need them for collision
now is now.. what do you need them for now? :p
For real though this is no information. Do you want them to actually turn into a single giant collider, do you want them to be treated as one for an OnCollision function or what?
If it is a 2D game then you could just use a polygon collider.
Answer by Eric5h5 · Jul 08, 2017 at 03:32 AM
You can compute the coordinates of the various box colliders, then use them to create single a PolygonCollider instead, by setting the pathCount for the collider, followed by SetPath with the appropriate index and coordinates as many times as needed.
Answer by Cornelis-de-Jager · Jul 07, 2017 at 12:30 AM
Create children objects, each with their own collider. The Parent will treat their colliders as a single one.
Your answer
Follow this Question
Related Questions
Change polygon collider depending on the animation 0 Answers
Weird ContactPoint2D on two BoxCollider2D collision 0 Answers
Unexpected token: collider? 1 Answer
No Collision in 2d Scene 0 Answers
Animator resetting my colliders2D 0 Answers