Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Gravity on objects with large drag is extremely unrealistic

Discussion in 'Physics' started by ThatProgrammerJack, Apr 8, 2023.

  1. ThatProgrammerJack

    ThatProgrammerJack

    Joined:
    Jan 6, 2019
    Posts:
    32
    I've been working on a plane simulator, and for realistic horizontal movement, I've set the drag value to 1. This gives me the motion I want on the horizontal, but makes gravity extremely unrealistic.

    If you turn off the throttle and let it freefall, the plane will accelerate for maybe a second, and hit a terminal velocity of only 30m/s. It just moves at a constant through the air, looking rather stupid and unbelievable as it does.

    Is there any way to change drag on an individual component basis? Or is this the limit of Unity's physics engine?
     
  2. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,497
    That's how Unity/PhysX works.

    In your case, you shouldn't use the rigidbody drag (leave it at 0). Just calculate and apply the drag force yourself, so you could implement drag in the precise way you need.
     
    arkano22 likes this.
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,891
    PhysX’s built-in drag force does not take into account the shape of objects, only their velocity, since it is not designed with aerodynamics in mind.

    For any plane simulation no matter how simple you want to calculate aerodynamic drag/lift forces yourself. A basic airfoil model that takes wing area and orientation into account is a good starting point: https://www.engineeringtoolbox.com/amp/lift-drag-fluid-flow-d_1657.html

    Note that any custom forces you calculate can be applied to any object on an individual basis using Rigidbody.AddForce.
     
    Last edited: Apr 17, 2023
  4. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    48
    As everyone else said, the drag property is a scalar which applies linear drag to all components of the physics body. If you want more accurate simulations given drag is a tensor, you'd need to implement it manually using AddForce().