Problems and questions about Destroy

I am trying to make a damage script (what I give is only the beginning concept) that will make the object go away when health reaches 0. In the actual script I will have it check the current health under the function update, but for starters I wanted to get the hand of the Destroy function. When I call this script in a gameObject called cube, nothing happens. If what I have is correct, what do I need to do in order to actually see the object go away when testing the game in game view?

Also for OnCollisionEnter, will it be triggered if an object is rezzed (rendered) on top of the object with the script in? EX I have an explosion consiting of three rings. The inner ring will have a tag of d30, the middle d20, the outer d10. It will be created by the bullet when it hits a target.

public var health = 100;
function update () {
    Destroy(gameObject);
	//update the health visual here
}
function OnCollisionEnter(coll: Collision) {
  if (coll.gameObject.tag == "d10")
  health -= 10;
  /*if (coll.relativeSpeed > 100) 
    health -= 20;
  else if (coll.relativeSpeed > 50)
    health -= 10;*/
}

You typo’d “update”, should have an upper-case “U”. So I don’t think your “Destroy” is ever firing. :stuck_out_tongue:

Stupid errors -.-

It works now. I guess I will test out the whole collision thing and see what happens then.