Hello. I present to you a rather interesting question.
I need to create ragdoll-physics for characters. I use the most famous and probably the only way: using limited revolute joint at image (then choosing a sprite and setting the parameters (values) of "flexibility", that is, we set the angle to which the limb (arm, for example) will bend). It works marvelously, but only until the limbs of the NPS start to take a random value (by default in all lessons sprites have such a position, which is very convenient for the functioning of ragdoll). For example, the NPS will run and in the state of "running" ragdoll will turn on, the required limb is not in the "default" state - in this case, the usual values do not fit, and the limb begins to bend unnaturally in one direction, and in the other underbend.
I attach the most primitive source of what this looks like. It recreates some part of the ragdoll in the way I use, missing only two arms and legs. On its example now I'll explain what I need: when I run the source, the head (brown sprite) can deviate 10 degrees forward and backward. This is with "default sprite values". Now in the editor itself we change the angle of the head, let's say, by a symbolic 10 degrees backwards, so that the result is 350. Run the project and find out that the head can be tilted forward to a maximum of 0 degrees and backward to 340 degrees (with a clamped SCM, you can control the physics of the head).
Question: how can I make it so that regardless of the position of the head, its flexibility is natural (i.e. 350 to 10 degrees)?
I hope I have explained it correctly. I really need a solution to this question, so I am open to any versions and counter questions.
drive.google.com/file/d/1wHI6lWJr4-6hpTBps1vgYhIAp5e1NvIS/view