- Home /
Circle colliders and polygon colliders
Hello,
so i have my character of my game which has a 2D circle collider and i have an ememy that has a polygon collider. When they collide nothing happens. The enemy has a unique shape and cannot have a circle collider, but when i change it to a circle collider everything works fine. What am i doing wrong here can these two physics objects interact with each other?
thanks, swampman
LaneFox,
They both have Rigidbodies2D and neither of them are $$anonymous$$inematic. When I say nothing happens I mean they do not collide with each other. This is just because one has a circle collider and the other has a polygon collider. If i make them both circle colliders everything works as its supposed too.
Thanks, Swampman
Hmm, well thats not normal. Is this with a drop test where the objects drop via gravity or are you manipulating them somehow?
I fixed it. I just decided to go with another circle collider. It was basically a fish jumping out of the water trying to eat a bug. I decided I didn't want the whole fish to be a collider just the mouth. So I set up a small circle collider inside of the mouth of the fish and it works fine now. This accomplished what I wanted to do.
Thanks for the quick response though, Swamp$$anonymous$$an
Answer by LaneFox · Jul 01, 2015 at 11:29 AM
Can you clarify what you mean by "nothing happens"?
If the objects have Rigidbodies and Colliders then physics should push them apart (if you didn't make them Kinematic). However if they do not have Rigidbodies then they are allowed to overlap without issue.
Answer by sansol · Jul 01, 2015 at 03:34 PM
hi there,
just fyi, i have had the same issue, and found out that colliders behave different when they have "depressions". i try to explain: a collider with an "O" shape will collide just fine, but one with a "C" shape would not, since it goes inside itself.. hope i'm making some sense? :-s
that btw happened to me in both 2d and 3d.
and the solution, as you already did, is simplifying your collider. either as you did to a basic shape OR just by taking away the "depression" (in the previous example the solution would be some kind of flipped "D" shape, where we close the entry the "C" shape has.)
hope i made myself understandable and you can use in the future.