# Question Is it possible to move object by rotation with single rigidBody?

Discussion in 'Physics' started by syjgin, May 21, 2024.

1. ### syjgin

Joined:
Feb 13, 2015
Posts:
139
Hi.
Is it possible to move object with single root rigidBody and multiple colliders inside? I want to move object with a voxel wheels, but looks like there are necessary multiple rigid bodies with hinge joints. But that solution is poorly compatible with drag and drop: when you quickly move object, that consists of multiple rigid bodies, it temporaly desintegrates by separate parts.
But without joints object can't be moved by the wheels, as you can see in the sample project attached. Maybe, it's possible to do this without joints?

File size:
210.9 KB
Views:
8
2. ### arkano22

Joined:
Sep 20, 2012
Posts:
2,063
Yes, you can have a single rigidbody with multiple colliders inside. This is a very common setup, called a compound collider.

Edy likes this.
3. ### syjgin

Joined:
Feb 13, 2015
Posts:
139
Yes, but let's try attached example: such compound collider can't be used to car wheel like movement: without multiple rigid bodies game object will not be able to roll from it's initial position

4. ### arkano22

Joined:
Sep 20, 2012
Posts:
2,063
You can't have objects independently move with respect to each other if you have a single rigidbody as in your original question:

The only way to have two objects move independently is for both to be rigidbodies. If you then want to constrain their relative movement in some way (limiting translation and only allowing rotation, for example) then you *must* use joints.

Note that joints aren't perfect, so large hierarchies of objects and/or large mass differences in objects joined by joints may exhibit incorrect behavior. You have articulated bodies as an alternative, which are a lot more robust for these cases but come with their own limitations and somewhat increased cost.