|
Hiya guys. I am tring to create a human body with fully controllable joints. In the end it probably would look something like this: QWOP (I am also working in 2d) I am using configurable joint with these settings:
The script to control the movement is this: So THE PROBLEM is basically this - it doesn`t work the way I want to. The value of "targetAngle" can go higher or lower than the angle the leg can bend, and that causes the legs to jump around (if I hold down long enough for targetAngle go from +70 to -70 the wrong way) or a lag between movements (when targetAngle crosses the 70* line, and I have to wait for it to move back). I am pretty new both to Unity and programming, and can
(comments are locked)
|
|
Fixed it with this line targetAngle = Mathf.Clamp( targetAngle, -70, 70);
(comments are locked)
|

I also tried to use transform.rotate on different limbs with character joints, but it doesn`t seem to work either :/
Is this question too hard or not clear enough? :/