- Home /
 
spring joint minimum distance
Unity's spring joints work exactly the way I need them to (imagine an object tethered to another). Unfortunately, it doesn't appear as though there's a way to adjust the minimum distance. Everything I've read says that the connected body's distance at spawn is the minimum distance, and I don't see any way to adjust it via code or otherwise.
Answer by drizztmainsword · Jun 10, 2012 at 09:10 PM
So, there are minDistance and maxDistance variables on any SpringJoint. The documentation says that these numbers are relative to the initial distance between the two objects connected by a spring joint, meaning that the actual minimum distance a spring joint allows is equal to the initial distance + minDistance.
Try setting the minDistance variable to a negative number at runtime (or in the editor if you can) and see if that helps.
I am having the same issue with the initial distance and orientation between two objects connected by a spring joint.Setting $$anonymous$$Distance to a negative value through scripting will give an error.
Your answer