Skip to content

Instantly share code, notes, and snippets.

@geta6
Created October 21, 2011 09:21
Show Gist options
  • Save geta6/1303430 to your computer and use it in GitHub Desktop.
Save geta6/1303430 to your computer and use it in GitHub Desktop.
Collision
var smokePrefab : GameObject;
function OnCollisionEnter(collisionInfo : Collision) {
if (collisionInfo.gameObject.tag == "Box") {
collisionInfo.gameObject.SendMessage("ApplyDamage");
}
Instantiate(smokePrefab, transform.position, transform.rotation);
Destroy(gameObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment