Hello- forgive me if this has been covered elsewhere; I did a preliminary search in the forums and didn’t see anything that seemed to address this. I’ve been experimenting with the joint system and this is where I am.
I have a series of spheres (because they are cheap to make) connected like so:
O-o-o-o
where O is kinematic and the rest are character jointed onto the sphere to their immediate left. What I want is to be able to have each joint “bend” say, 30°, within the physics engine. So I set it up as follows:
Axis> X=0; Y=1; Z=0
High Twist Limit> Limit=20; Bouncyness,Spring,Damper=0
I tried giving each of the smaller spheres an Update call such that if space was down they called
rigidbody.SetTorque(0,-50,0);
This works ok, but they overshoot the High Twist Limit. Similarly, when I move the main sphere around they will swing around backwards (and I would like them to hit a “wall” at 0° rotation and lock into place.
Is there a better way to do this? Am I even making sense?
Thanks!
Also, Hi! I am new!
No one? I will try and restate the question more simply.
A->B->C (B has a character joint with A as the target, etc for C). The joins have twist limits of 0 for the time being.
When I rotate A, the torque does not change B’s position much (it changes some) but C is clearly bent beyond the constraints that I thought twist limits imposed (if I increase the chain length, they start wrapping around A). I have tried adding bounciness, extremely high spring values (“infinity” seems to break something)… no go: the limits seem to be just vague suggestions.
Is there a way to lock the rotation of a joint at a given value without using a fixed joint? These objects essentially form an arm and I don’t want the elbow to bend backwards, but I do want to be able to bend it forward within the physics engine…
thanks!
Hi.
Irc the character joint is not fully implemented. So springs and some other things are not working. If you’re just bending in one axis (like an elbow joint) I would use the hinge joint, it works perfectly. Use the target position of the spring to set the angle you want for the joint.
/Patrik
Thanks! I will try that instead.
So the hinge joint works better in general I think, but when I stop applying a torque force and they bounce back, they still overshoot the target I set in the spring settings. Is there a way to make it so:
- torque is applied to arm
- arm hits 30° rotation and stops (no bouncing or overshooting)
- torque application ceases
- arm returns to 0° (no bouncing or overshooting)
I feel like I could do this with transforms rather than the physics model, but I’d like to impart force when the arm hits something.