Skip to content

Instantly share code, notes, and snippets.

@poemdexter
Created January 26, 2014 07:08
Show Gist options
  • Save poemdexter/8629590 to your computer and use it in GitHub Desktop.
Save poemdexter/8629590 to your computer and use it in GitHub Desktop.
get the children
foreach (Transform child in transform) {
child.parent = null;
child.collider2D.isTrigger = false;
child.rigidbody2D.isKinematic = false;
child.rigidbody2D.AddTorque(Random.Range(-torquePower, torquePower));
child.rigidbody2D.AddForce(new Vector2(Random.Range(-.5f, .5f), 1.0f) * forcePower);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment