Airplane Physics: One or multiple rigidbodys?

Hi there,

I’m wondering about adding more than one rigidbody to my airlane’s physic environment.
Of course I added at least a ‘base’ rigidbody to my plane. My approach would be to simulate wings with a AddForceAtPosition() call on the base rigidbody.

But I am wondering about adding one additional rigidbody per wing as child to the plane. So I can simply use AddForce() to simulate the upward force of a wing. The other effect would be a different drag value for the wings than for the plane body to simulate air resistance.

I want to make the physics as realistic as possible. And the user should be able to customize a plane. F.ex. add additional weight to the front or bottom of the plane to edit the center of mass so it fly’s better (or even worse if he makes it wrong).

The goal is that the player ‘makes’ his own plane so he can move the wings, add weight, add an engine, …

And that’s why I thought of adding rigidbody’s to all of the components the player can add. Or should I calculate every single component he could at and add all the force to the single plane rigidbody.

Id like to simulate a wrong center of mass, that means if the player adds his wings at the very front of the plane and maybe some weight to the back, it should make some sort of backflip after takeoff (if it takes off…)

I hope you’d get the point.

Thanks for any answer!

Rob

No as a rule it’s just one rigidbody for the whole aircraft. But I’ve got good news…do you want the good news or the other good news??

the secret you are looking for is …add force AT POSITION …

regarding the COM … more good news, you can set it !

PS just a thought. If you’d looked at the rigidbody doco page, you would have seen all this great stuff and saved yourself a few minutes. Enjoy

PPS don’t forget too you can torque the body other than applying offset forces. that may be better for you

PPPS if you’re a badass and did high school math you can set the moment of momentum. Naturally, for normal use the game engine sets the moment itself, in an undocumented but “obvious” way based on the shapes of the colliders, (presumably it assumes the density of the material is uniform.)

PPPPS conceivably, you could get in to attaching your wings with spring joints. they are awesome, but fiddly. i really don’t see it as your answer though.

Howdy Everyone! I created a course on Udemy that covers how to set up Airplane Physics in Unity. not sure if it will help, but I wanted to post it here as it may help! Thanks!

Udemy Link: https://www.udemy.com/intro-to-airplane-physics-in-unity-3d/?couponCode=10DAOLLARPHYSICS

Youtube Link: Intro to Airplane Physics - YouTube