OneBodyLinearServo does not seem to pull Body all the way to Target
Posted: Fri Jun 14, 2019 7:56 pm
Hello!
I am trying to get a Ragdoll to stand upright, and to do that I am using a OneBodyLinearServo for the head, chest & hips of the Ragdoll, with each Target set to the desired positions of the bodies above ground. The Servos are affecting the bodies and keeping the upright, but not all the way to the Target posititions.
How I add the Servo:
How the ragdoll looks in-game:
The simulation is run server-side, and only the position of the hips and the rotations of all bodyparts are synchronized. The hands and feet are not yet synchronized properly, but that should not influence the position of the hips, as that is sent directly.
I have tried messing around with the maxiumForce of the ServoSettings, but maximumForce only seems to affect the speed at which the Body is pulled to the Target, and not how close it gets. Much of my code is taken from the Grapper class in the demos, and it also seems as if objects are not dragged all the way to the cursor when pulled around in the demos (Which is most likely on purpose, but I am not aiming for that kind of behavior here).
Any help is highly appreciated
I am trying to get a Ragdoll to stand upright, and to do that I am using a OneBodyLinearServo for the head, chest & hips of the Ragdoll, with each Target set to the desired positions of the bodies above ground. The Servos are affecting the bodies and keeping the upright, but not all the way to the Target posititions.
How I add the Servo:
Code: Select all
SpringSettings defaultSpring = new SpringSettings (5, 0);
force = 250
LinearHandle = simulation.Solver.Add (body, new OneBodyLinearServo ()
{
Target = target,
ServoSettings = new ServoSettings (float.MaxValue, 0, force),
SpringSettings = defaultSpring
});
The simulation is run server-side, and only the position of the hips and the rotations of all bodyparts are synchronized. The hands and feet are not yet synchronized properly, but that should not influence the position of the hips, as that is sent directly.
I have tried messing around with the maxiumForce of the ServoSettings, but maximumForce only seems to affect the speed at which the Body is pulled to the Target, and not how close it gets. Much of my code is taken from the Grapper class in the demos, and it also seems as if objects are not dragged all the way to the cursor when pulled around in the demos (Which is most likely on purpose, but I am not aiming for that kind of behavior here).
Any help is highly appreciated