How to Rotate a Part Around Another Part Using Constraints?

Hi everyone,

I want to create something like this, where the blue part rotates in a circular motion (keeping the same exact distance indefinitely) around the black part:

Is there a way to achieve this using only constraints?

Thank you.

2 Likes

I would use a rope constraint connected to the center part and the spinning part, then use a body force to spin it

1 Like

Use WeldConstraints to achieve this.

1 Like

Weld constraints limit the distance that you can move it, and you would have to spin the center part along with the outer part.

1 Like

No, you would only have to spin the center part.

1 Like

Yes, I said that

I don’t want to start an argument, but let’s say that you were trying to move a part around another part and you wanted to change the distance, having a weld constraint cannot do that, in addition, the part’s would have to be right next to each other.

1 Like

While it is true that WeldContraints cannot change the distance, that is not what is trying to be achieved here.

The parts would also not have to be next to each other. They can be separated.

1 Like

I don’t have my studio right now, but from previous experience, yes you can separate them, but they will come together once you play test them. I’m not sure if I mixed them up with another constraint it happens often.

Sorry if I was being annoying.

1 Like

weld
I made this in my game using WeldContraints. It works perfectly fine. They still keep their distance.

And you can never be annoying for helping someone.

5 Likes

As previously stated, you can achieve this linking the blue part to the black part either with WeldConstraints or RodConstraints, which would both work on any axis for unanchored parts. If you want the line between the parts to be visible, use the second option.

Finally, attach an HingeConstraint (don’t confuse it with CylindricalConstraint :wink:) to the black part to make it rotate. Then the blue part will be rotating along with the black one!

More info:

Also, it is not recommended to use body movers such as BodyForce if you can just use the ‘new’ constraints.

4 Likes

Thank you very much.

However, I tried RodConstraints and they didn’t make the part spin like I intended, it even stopped the center one from spinning. Therefore, I used WeldConstraint to join the outer part with the center one and I used HingeConstraint to make it spin like one of the DevHub articles teaches.

1 Like

lol i came here from the search bar . Thank you for the help :grinning_face_with_smiling_eyes: