Rotation Issue, How to simulate a bearing physics in Unity

Hello everyone.

Hope some experts/experienced users can answer this question:

I’d like to simulate the basic motion of a bearing in Unity (a snapshot can be found attached),
so, I created 3 CAD models, inner ring, outer ring, and a roller, ones the models are imported into Unity,
I applied mesh collider and rigid body on three components separately, and I applied a constant torque on the inner ring, I don’t know why the outer ring will rotate with the inner ring with same speed (same as the roller).

I was hoping, the inner ring will drive the roller to rotate, and the outer ring stays steady (or rotates in a lower speed ), how to achieve that?

Thank you!

Leo.

To use a mesh collider on a rigidbody you have to enable the convex setting. And doing this will turn your rings into solid discs. You can test this by turning your rings onto their side and trying to drop a sphere through them.

But sure would be nice if PhysX supported more shapes…

1 Like

Yes, I enabled convex setting, but still, if I apply a constant force to the inner ring, the outer ring will rotate together with it. and if I make the outer ring fixed, the inner ring would not rotate, is there a way to fix it?

I think you misunderstood. I’ll explain a different way. When you enable convex Unity will modify and simplify the mesh collider so that it no longer contains an inner surface. So your rings have ceased to be rings and they’ve become intersecting discs that are jammed together and so when you rotate the inner disc then the outer disc will also rotate because of friction.

I can’t blame you for being confused because after enabling convex it isn’t always obvious looking at a mesh collider that it has been modified. Your rings will still look like rings in the editor, but if you look closely you’ll see that the green mesh collider doesn’t have any inner polygons.

1 Like

Your response is quite clear and I finally understood,
in this case, is there any other ways to achieve what I was expecting?

It’s possible to use a capsule collider for the inner ring and the cylindrical bearing but there isn’t a physics shape that you could use for the outer ring. But perhaps you could fake the system and just rotate everything manually.

I know some folks have previously tried to create gears using the physics engine but they gave up and rotated their cogs manually.

or the other type of plugin that creates primitive colliders to “fit” mesh collider area.

I would recommend considering why are you attempting to simulate a bearing in Unity.

• Is it for engineering purpose ? → No way you are getting any meaningful results out of Unity. Even if you get it somewhat working most likely the numbers won’t be usable for anything, likely not even right order of magnitude.

• Is it supposed to be just a visualization? → You might want to consider just animating it.

• Is it for gameplay purpose ? → Scripting/animating might still be best choice. Depending on gameplay purpose you could use an appropriate physics joint, and drive the visuals by the state of joint.