Angular drag is relative to...?

Hey there,

I’m discovering the beauty of the physics system, but I bumped into a weird issue with a hinged joint:

I’m modifying the awesome free "Kawaii"tank model by Choby. I am trying to make it even more realistic by adding even more physics. Thus far this worked like a charm, but now I found a weird issue:

I added a hinged joint to the turret. This joint is linked to the main body of the tank. I bound 3 keys to the turret:
-One key applies torque clockwise
-One key applies torque counterclockwise
-One key sets the angular drag to a high value, so the turret can be “braked”.

This works perfectly if the tank is stationary, or driving in a straight line, but it is not working as expected when the tank is turning. If the Angular drag value is low or zero, the turret always points in the same world direction, even if the tank is turning (so the turret is rotating relative to the tank, even if no torque is applied). This seems perfectly normal behaviour caused by the angular inertia of the turret. But when I set the Angular drag to a very high value, the turret will still keep on pointing in the same world direction if the tank turns. This is not what I expected: I would expect that the high drag would force the turret to follow the body to some extent, but no matter how high I set the angular drag, the turret completely ignores the body rotations.

The angular drag only seems to apply between the world and the turret, but I would like it to apply between the tank body and the turret.

Any suggestions?

Angular Drag is relative to the world. It just reduces the global angular velocity of the body. So increasing angular drag is probably causing a worse effect in your case, as the turret will be more keen to stay stationary.

I’d try using a Configurable Joint and specifying the constraints in a better way to force both bodies to keep the same relative position. You may later using the Angular Drive features for rotating the turret.

After some more experimenting I found out that using the drag of the rigidbody component in order to brake was a wrong conceptual choice.
But I did get some very nice results by using the motor, which is part of the hinge joint itself:
-To simulate friction in the joint, one can set the target Velocity to zero, and the motor force to a relatively low value
-To simulate a brake, one can set the target velocity to zero and the motor force to a very high value.
-To simulate a motor driving the turret, the target velocity should be set to the maximum speed at which one wants the turret to be driven, and the motor force to some intermediate value.

Excellent results now :smiley:

1 Like