Search Unity

Change Drag to Quadratic Drag Force

Discussion in 'Physics' started by mentalgear, Aug 1, 2019.

  1. mentalgear

    mentalgear

    Joined:
    Jul 19, 2019
    Posts:
    23
    I just finished watching the following video from GDC about a talk on how to make physics more realitic in unity.
    The speaker recommends using a quadratic function for drag force in unity instead of the normal linear one.
    However, I don/t seem to find how to change the default drag function in unity. Anyone can give me a hint ?

    Video:
    Forward to more or less 18:00 for the comment on drag:
    https://www.gdcvault.com/play/1021921/Designing-with-Physics-Bend-the
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,492
    There isn't a stock option for that but all drag does is manipulate the velocity, something which you are free to do using whatever function you like.
     
  3. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,492
    mentalgear likes this.
  4. mentalgear

    mentalgear

    Joined:
    Jul 19, 2019
    Posts:
    23
    Wow, great thank you Melv so much !
    In case I want quad. drag for all my objects in the scene, would I need iterate over all the game objects and attach a script called quad. drag to them, or is there a more elegant solution ?

    Since you seem to work with Unity, and since Unity seems to explore other phX engines and also wants to become a player for (robot) simulations (that's actually what I explore unity for), wouldn't it make sense to add quadratic/realistic drag as a chosable default ?
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,492
    It could be added but would require changing the respective physics engines (Box2D and PhysX source) and there's not been a huge call for it. Things tend to get implemented prioritised on that.