- Home /
How to stop stretch armstrong?
Look at this image:
I have an issue where when explosion force is added to a ragdoll character, the joints fly apart. They very quickly return to normal distance, but it's still very noticeable that the arms fly off in ridiculous positions at the moment of impact.
The character is setup using CharacterJoints and rigid bodies, all connected up properly (using Ultimate Ragdoll Generator). I tried playing with the spring/dampen values in the swing1 and swing2 fields of the CharacterJoint, but no luck.
Does anyone know how to tell PhysX to stop playing Stretch Armstrong with my characters?
I found a hack workaround, which I posted below. Here it is again: In my Characters class, whenever the character is in ragdoll mode, I use the LateUpdate method to reset the localPosition of each bone to its original values. This counteracts the visual side of things, so it all looks good, but I'm sure there's going to be some weird physics issue down the road
Hi!, newbie here.
by "rest localPosition of each bone to its original", you mean...
Component[] bones = gObj.GetComponentsInChildren(typeof(Transform));
then loop through the bones
and go transform.localRotation = transform.localRotation?
how do you know its original pos?
Thanks in advacne.
Here's what I'm using, I added this script to all limbs:
public class LimbStretchHack : $$anonymous$$onoBehaviour {
private Vector3 startPosition;
public void Start()
{
startPosition = transform.localPosition;
}
public void LateUpdate()
{
transform.localPosition = startPosition;
}
}
Answer by MaiJingNan · Jul 24, 2016 at 08:39 AM
I've found a solution which seems to work perfectly now. Enable projection on the character joints.
default settings just magically made the problem go away.
THAN$$anonymous$$ YOU THIS WOR$$anonymous$$ED FOR $$anonymous$$E TOO! Had a $$anonymous$$ecanim character that was glitching out loads when being moved by other objects, this fixed most of it!
Answer by robertbu · Jan 19, 2013 at 07:28 PM
I too would like an answer to this question. I asked a similar question and never received and answer, and I've seen one other posts with similar questions in the last week or so. What that said, I got my best results using a ConfigurableJoint. Turn on Projection mode in the joint and Freeze X,Y, and Z motion (not rotation). I also found that playing with the mass made a big difference for what I was doing (collisions not explosive force).
Answer by superme2012 · Mar 27, 2013 at 07:52 AM
me 3, just got into the same problem.. Elastic stretchy effects, not so nice results ;)... I believe it may be down to the settings of the Ultimate Ragdoll Generator. I got URG to help speed up development and now its slowing everything down lol..
It seems to be loosing the connection between the bones for a split second, but it is constant on every test and causing some serious issues... I am also using explosive force..
I had some other really good ideas where to use URG to ;(
I found a workaround, but it's not ideal. In my Characters class, whenever the character is in ragdoll mode, I use the LateUpdate method to reset the localPosition of each bone to it's original values. This counteracts the visual side of things, so it all looks good, but I'm sure there's going to be some weird physics issue down the road.
Answer by NishantSood · Oct 07, 2013 at 05:20 AM
I found the solution to the problem. I was using a humanoid setting under the rigging tab of the fbx file that i was using To fix the problem you have to 1)Configure the model 2)Then in the mapping tab at the end open the drop down menu which says mapping 3)Select Clear Map and the select automap 4)Then in the next drop down menu select Pose>Enforce T-pose 5)Then Select Done.. I hope this will fix your problem
Your answer
Follow this Question
Related Questions
How can i flip a ragdoll ? 1 Answer
add torque at position 2 Answers
ragdoll force trouble 0 Answers
Reading normal force between colliders 3 Answers
Visualize character joint swing and twist axis script 0 Answers