Rigidbody.drag Manual     Reference     Scripting  
Scripting > Runtime Classes > Rigidbody
Rigidbody.drag

var drag : float

Description

The drag of the object.

Drag can be used to slow down an object. The higher the drag the more the object slows down.

JavaScripts
function OpenParachute() {
rigidbody.drag = 20;
}

function Update() {
if (Input.GetButton ("Space")) {
OpenParachute();
}
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void OpenParachute() {
rigidbody.drag = 20;
}
void Update() {
if (Input.GetButton("Space"))
OpenParachute();

}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def OpenParachute():
rigidbody.drag = 20

def Update():
if Input.GetButton('Space'):
OpenParachute()