- Home /
Capsule Collider on Cylinder Doesn't Work
Hey Guys!
I made an oil barrel (cylinder) and put a capsule collider on it. But now, when it falls and hits the ground while tilted, it rolls around the wrong way at both ends (it cuts off the corners), because of the sphere ends of the capsule. And i can't change the rotation constraints, because then it just falls straight down while tilted, which is very unrealistic. And if I use a mesh collider, it will fall through my terrain/plane. Thanks for all the help!
Answer by Eric5h5 · Jun 03, 2011 at 05:48 PM
Use a convex mesh collider.
ummm, where do I get those. I know, I am a total Newbie!
@cgartist4jc: when you add a mesh collider, look at the checkboxes in the mesh collider component; should be fairly obvious.
Thanks for putting up with the newbie I checked the "convex" box, and it still went through the plane. So I tried assigning a mesh to it, but when I click my mesh, I was rotated, scaled, and transformed wrong. what do I do?!?!
@cgartist4jc: try making it rotated/scaled correctly in your 3D app, or check the mesh import settings.
This solved it for me. Why do Cylinders default to a capsule collider? Convex mesh is far more accurate...
Two reasons: 1) You often want something cheap that's close to the right shape. Plenty of people are using it as a fixed-in-place column, for example, where a capsule collider is better (perfectly round.)
2) There's no correct $$anonymous$$esh collider. You rarely want to use the model's mesh for the collider. For example, you might need 24 verts around to make the model look good; but only 10 around for the collider is enough to make it roll nicely.
Answer by Owen-Reynolds · Jun 04, 2011 at 06:44 AM
A compound collider with a cube on each end doesn't act too badly (add an empty near each end, with only a cube collider.) Make the cubes a tiny but smaller than the capsule radius, so it rolls.
Your answer
Follow this Question
Related Questions
Mesh vs. Mesh Collider for simple game setup 0 Answers
Capsule Collider not moving with the character 0 Answers
Capsule Collider as a motorcycle simulator? 1 Answer
How to stop an object from moving rigidbody 1 Answer
Camera Rigidbody 1 Answer