Programmatically turn off gravity on rigidbody

I would like to turn off gravity after a specific event in my Unity game. Is there a way to turn off gravity programmatically?


use .useGravity


// Disables gravity on all rigid bodies entering this collider.
function OnTriggerEnter (other : Collider)
    if (other.attachedRigidbody)
        other.attachedRigidbody.useGravity = false;
// Turn this collider into a trigger on startup
collider.isTrigger = true;

In said event you would want to set the useGravity property of the rigidBody to false.