SFE_AddRandomForceTorque.js 281 B

123456789101112
  1. #pragma strict
  2. var rnd:float=10;
  3. function Start () {
  4. //rigidbody.AddForce(transform.right * Random.Range(-rnd, rnd), ForceMode.Impulse);
  5. rigidbody.AddTorque (Random.Range(-rnd, rnd), Random.Range(-rnd, rnd), Random.Range(-rnd, rnd), ForceMode.Impulse);
  6. }
  7. function Update () {
  8. }