- Home /
reading forces applied to a rigidbody
i'm working on a project that uses rope physics, where one end is attached to a fixed point, and some position down the rope can be manipulated by the user
the problem is that once the rope is pulled tight, the segments start displaying a wild jittering behavior
the rope system i'm using appears to consist of various rigid bodies joined together with hinge joints, and i would like to be able to detect when tension is applied to the rope in order to prevent this jitter and instead "slide" the rope down the user's hand, in order to do so i can't use velocity, as the user's pulling force and the tensile force cancel out, leaving only the jitter as noise, which is exactly what i'm trying to prevent (preferably before it's very noticeable)
so in the end my question is: is there a way to do one of the following:
read tension on joints?
forces applied to joints?
forces applied to rigid bodies?
Answer by Antony-Blackett · Dec 17, 2014 at 12:08 PM
Looking at the Unity Reference docs I can't see any direct way to read the tension or forces as you'd like to...
One thing you could try is to test if the rope is straight, if the rope is straight and your user is pulling in the same direction as the rope then you can assume that it's pulled fully tight.
You can see if the rope is straight by getting the Vector3.Dot() of each node in the rope down the chain, or alternatively reading the hinge joint angle and testing that they are within some threshold range along the way.
Hope this helps.
unfortunately the rope starts to jitter well before the rope is straight due to its own weight, and that's at a mass of 0.0001, and the fixed end of the rope is actually attached to the ground, this ends up resulting in the average dot product increasing as the rope is pulled off the ground, then slightly decreasing as some $$anonymous$$or tension is applied, before increasing again due to jitter, the same happens when testing the angles