Search Unity

ForceMode on Rigidbody2D

Discussion in '2D' started by mheydlauf, Nov 28, 2013.

  1. mheydlauf

    mheydlauf

    Joined:
    Nov 1, 2013
    Posts:
    10
    Hello,

    I need to apply a Torque impulse on a Rigidbody2D. Unlike Rigidbody, I noticed Rigidbody2D does not contain the overloads on AddForce/AddTorque that accept a ForceMode parameter.

    Any ideas on the math behind ForceMode.Impulse and how I might use it to simulate an impulse via AddTorque?

    For added reference, my game is a port of an XNA/Farseer Physics (c# port of Box2D) game. My control scheme applies impulses to the character. I use impulses over forces because I find the responsiveness/control of the character much more manageable that way.

    http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddTorque.html

    http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody2D.AddTorque.html

    http://docs.unity3d.com/Documentation/ScriptReference/ForceMode.html

    Video from my XNA game I'm porting

    Many thanks for your help,
    Mike.
     
  2. DrKucho

    DrKucho

    Joined:
    Oct 14, 2013
    Posts:
    140
    there is a lot of stuff missing in the new 2D engine , hope they include it on next versions :(