Hey there. Have a little question.
I am using Rigidbodies connected by my artificial muscle to make them bonded.
The muscle has the ability to contract and extend by a certain (user defined) amount around
a base value. Example: The middle between two bodies is 2m. The user sets extend and contract value to 1m.
so the Objects can contract to be 1m apart and extract to be 3m apart ( and any value between those two).
To make the muscle act a little realistic (if a muscle could extend that is) and make it work with physics I use a suspension + damper system.
I have defined 2 variables: SuspensionConstant and DamperConstant.
For the suspension, the formula is:
SuspensionConstant * (currentLength - (middleDistance + movementDistance))
Here movementDistance is a value between -Contract to +Extend.
For the damping value I have:
dampingConstant * (Vector3.Projection(targetA.velocity, posA-posB));
dampingConstant * (Vector3.Projection(targetB.velocity, posB-posA));
This makes the Muscle retract and contract and retain to the desired position if overstretched or compressed.
Problem here is: If the Spheres which are connected by the muscle are spawned some meters above the ground the see how they fall, they start falling slowly or move in a direction equivalent to their connection-direction. This is because the dampingForce uses the speed and the speed is generated through gravity.
What I expected was: As I made both rigidbodies always have the same force acting in the exact opposite direction, the force should elinimate. But this is not the case as when falling down (for example one Sphere above the other) both spheres gets a speed in the same direction and thus have a force acting in the same direction.
My Question:
How could I solve this?