- Home /
Only make connected rigidbody move when distance is changed on 2d joint
I noticed that when the distance value of a 2d joint is changed during run-time, the object and connected object move evenly towards each other. So say I have two objects connected with a 2djoint, one is positioned at (0,4) and the other at (0,8), and I change their distance to be 2, both objects will try to move closer to each other until they are that value(2) apart. In my case this is unwanted because I have gravity being applied to these objects and when they both try to approach each other, it causes them to look like they're floating(for a brief moment). I only want the connected rigid body to move closer when the distance is changed. So, based on the last example, the first object would stay at(0,4) and the second would approach the first object from (0,8) until it equaled (0,6). So my question is how do I only make the connected rigid body move when the distance is changed on a 2d joint. Any help on this will be much appreciated.