- Home /
2D - How can I create an "inverted" circle collider?
I need to create a collider of the terrain in this picture:
I can not use polygon/edge colliders and I have no idea how to do the inverted colliders. :/
Um .. what do you mean by inverted collider? Is the circle shape necessary, or are you not just looking for colliders that match the outside of your terrain?
As you can see in the picture, the 2 colliders are 1/4 of a circle. But when I make a circle collider at their location , my character can enter the terrain below them and cannot enter the circles made by them. So, if I can somehow invert them and limit their size(to 1/4 of a circle), my problem would be solved. I might make another image when I get home...
Yes, I think we will need more information. Even after your explanation, I cannot understand the image enough to help. I am not sure what part of the picture is 1/4 of a circle. Another pic would be great!
I think what this guy means with the quarter circle are the parts that connect the circle to the terrain. I am in the dark on the problem... Did you see the button edit collider? I think that is what you want and need in this case.
Answer by screenname_taken · May 08, 2015 at 06:32 PM
If what you want is a circle/sphere but that you can walk on the inside instead of the outside, then what you need is to make a sphere in a 3D program and invert its face normals and use that with a mesh collider component. Mesh collision is calculated on those, so if the sphere's face normals are inverted, then it would be like having the earth hollowed out and walk on the inside. It would keep stuff from inside it, falling out. Keep in mind though that what ever is outside the sphere will be able to get in. You'll need a second sphere with its normals the right side out. Also, don't tick on convex as that means that the collider is filled.
It's worth noting that this will only work with 3D physics and not the 2D physics system. It depends on your needs.
Bleep Didn't see the big bold "2D" on the title. I guess the line terrain 2d collider is working on a similar way? I mean the one that you can jump from the bottom and land on top.
Your answer
Follow this Question
Related Questions
Cirlce Colliders 0 Answers
Detect a collision but allow prefabs to pass through each other 2 Answers
Draw 2d circle with Gizmos 6 Answers
Why does Physics2D.Capsule/Circle/BoxCast's hit point and distance not line up? 0 Answers
Creating a smooth flat circle? 3 Answers