- Home /
Different angular drag for different rotations?
Hi Everyone,
my ship control script is adding torque to its rigidbody to achieve different things. Now I really would like to have different angular drag for different 'parts' of the ships torque. Say for the left-right direction rotations and for the ground alignment orientation.
How can I do that?
Cheers Fred
do you mean you want it to ..
http://upload.wikimedia.org/wikipedia/commons/7/7e/Rollpitchyawplain.png
kind of stay tight on the roll (say), but wibble a bit more on the yaw ?
is that about right?
tricky - i would write a script, a behaviour, that flattens, $$anonymous$$imizes motion, on one axis. (say roll in the example). just attach that to the object and let it do it's stuff, regardless of anything else happening.
Hoep it helps in some way.
Also conceivably - you could put one rigidbody inside another, both constrained, and set the honey as you see fit on each one. BUT then you get all the usual problems of having chains of rigidbody.
Finally ... if you are hip to moments of inertia, and it has a collider attached,
file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Rigidbody-inertiaTensorRotation.html
consider these very long discussions ...
http://answers.unity3d.com/questions/280008/nested-rotations-for-snowboard-flip-turn-roll.html
http://answers.unity3d.com/questions/279358/equivalent-to-this-using-torque.html
Hi Again and thanks for your thoughts,
unfortunately I can't just separate axises and treat them differently. There is full xyz overlap in the rotations that I want to treat differently. I have just started thinking that maybe I have to do the simpler rotations by hand with transforms and roll my own 'angular drag'. I'll look through those links tonight. Cheers, Fred
I ended up scripting in my own turn drag. The thing I needed it for was the left-right steering that I wanted some feeling of weight to without having to use the same angular drag as my more complex alignment setup.
So I did a basic buildup of turn velocity and then subtracted a simple turn drag based on my general air resistance part of the script.
Surprisingly it seems to have worked.
Ouch, the reason it was surprising was because it actually did not work. Back to tweaking. Need to be even more manual I think with transforms as end product rather than angular vel. We'll see.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092502im_/https://answers.unity.com/themes/thub/images/avi.jpg)