- Home /
How to use a joint or other methods to create a joint-like effect that allows a rigidbody to rotate around an anchor in all axes?
I am relatively new to this and I was trying to use joints to make certain rigidbodies "orbit" around an anchor. This anchor was going to be the center of another rigidbody the others could lock themselves to, or break away from, with enough force.
I also wanted to make this connection a spring, but unlike springjoints (as far as I could understand them) this one would have to behave more like a real spring, pushing the rigidbody away if it is closer than the "rest distance". The spring part, however is not really necessary, the free rotation is the really important part.
I tried using configurable joints, but they are beyond my understanding and even after some experimentation with them I could not generate the desired behavior.
I hope this image helps explain it even more:
Any help is massively appreciated.
Answer by unity_DKqnJkGo8MOKYQ · Jan 28, 2019 at 06:12 PM
Sounds like a plain spring joint to me. Did you try the spring joint? I allows for free rotation of the bodies, and will both push away and pull together, based on distance.
I thought so too so it was the first one I tried. I tested this before and couldn't get it to work, but after further testing I found out that the Autoconfigure Connected Anchor actually changes the behavior to what I desire. So you're right, but it's important to point out that the Autoconfigure Connected Anchor needs to be turned on.
Thanks a lot for the help!