- Home /
Circle (Squished Sphere) Collider
Hello,
I have circular object that I want assign a sphere collider to in order to get more accurate collision with my object; the problem is that I need a sphere that's sized correctly in X, Y, but fairly flat in Z (i.e. a circle or disc). Is there any way to configure a unity sphere collider to do this? Should I use a different collider?
Thanks,
Answer by tayl0r · Jul 12, 2012 at 10:46 AM
I'm not sure why they just don't let the capsule collider have a slider for "rounded end cap" so you can change how far the rounded end cap sticks out... 0 would be a flat disc and ~1 would be how the capsule collider looks now.
As it is now, you are forced to either combine a bunch of sphere / cube colliders which gives wonky results or use a mesh collider which will perform worse and not collide with other mesh colliders unless you have "convex" checked, which decreases performance even more.
By wonky results I mean if you try to stack a bunch of cube colliders on top of each other (each one roughly the size of the disc and rotated by ~20 degrees), the friction and collision does not behave the same as if you just have a single collider. Somehow the stack of colliders is breaking it.
I did not try creating a disc out of cube or sphere colliders that do not overlap. That might be worth a try. I am happy using a mesh collider (for now).
Answer by Zu01 · Aug 20, 2010 at 02:05 AM
Try wheel collider, Ive never personally used it but it might be what your looking for. Or try making it the shape you want in your 3d moddeling softwear then find it in unity and select add colliders or some thing. Its in inspector when you have it selected out of your hiercy. Push apply then BOOM! you have a collider fit for exactly the shape you have!?!?!
The wheel collider does not act like other colliders; if you drop something onto its circle, or try to push it through, there is no resistance.
Answer by Jessy · Oct 02, 2010 at 07:02 PM
Yes. A sphere collider is just a visualization for checking collisions in a certain radius; unfortunately, you can't constrain it to certain axes. There is no primitive collider for this shape; decide how accurate you need the collisions: it may be that you can use several capsule colliders rotated around a single vector, but most likely, a mesh collider is what you need.
Answer by saketh_1 · May 28, 2016 at 03:51 PM
cylinder is best i think
There is a cylinder object, but it just has a capsule collider on it.
Your answer
Follow this Question
Related Questions
Move ball to mouse while still getting stuck on collision 1 Answer
Player not going in right direction when parented 0 Answers
OnTriggerEnter2D triggers before the collision 1 Answer
2D collider problems. The colliders seem "unstable". 3 Answers
How to detect if a ball will collide with another, and the normal vector of the collision? 0 Answers