I have two objects connected by a spring joint A and B. A can move around, making B follow it. However sometimes B can get into a kind of orbit around A, if A moves in a circular movement.
Is there a way to make B fly straight towards A without orbiting around it (or at least move towards A as fast as possible)? I have tried changing various setting on the spring joint without any luck.
it doesnt sound like you want a spring at all, you want a gravity well.
I believe it is something like this:
var object : Transform;
var gravametricPressure = 9.8;
function Update(){
object.rigidbody.useGravity=false;
object.rigidbody.addForce((transform.position - object.position) * gravametricPressure);
}
You could use something similar with a trigger event and trigger all rigidbody objects within an area multiplying the gravametricPressure by the Distance/radius.