- Home /
Compound 2D colliders not colliding properly
Hey Guys,
I'm getting an odd problem with 2D compound colliders where the compound object seems to behave very oddly around other, normal 2D objects. When the compound collider hits anything from the top/bottom, everything seems to work fine. However, when the collider touches objects from left/right I start to get strange behaviour. When I collide with the object's right side with my left, collisions seem to happen early and when I hit the object's left side with my right, collisions seem to happen late (object intersects, but then stops after a certain distance).
I realize this may be confusing with the way I worded it, so here are two pictures to illustrate what I mean.
The way I have my my hierarchy setup is that I have a 2D rigidbody at the root of the chain, with the player script that controls input/forces etc. I have a separate game object parented under the root which has a mesh renderer and a box collider.
I noticed that while changing the scale of the object that contains the collider didn't really break anything, but as soon as I moved the object from its center (i.e. a non-zero local position) this started to happen.
I've read stuff on the Unity 2D rigidbody/box collider docs and other forum questions, but I haven't really seen any warnings about this kind of behaviour.
Did anybody else run into similar problems when implementing a compound collider setup in 2D?
Your answer
Follow this Question
Related Questions
Is this a correct way to have multiple different compound colliders in one gameobject? 1 Answer
2d physics for balance game like Wii Party Pirate Ship 0 Answers
Effectors not working with compound collider? 2 Answers
Raycast2D hits itslf 2 Answers
Physics2D.Raycast.collider is always returning an object? 4 Answers