collision Problem

function OnCollisionStay(collisionInfo : Collision){
  if(collisionInfo.gameObject.name=="Floor"){
    gameObject.tag="Floor";
  }
}

function OnCollisionExit(collisionInfo: Collision){
  if(collisionInfo.gameObject.name=="Floor"){
    gameObject.tag="unfloor";
  }
}

The Second Work But The First Not why Pls Help

@whydoidoit is right: tags must be registered in the Inspector before you can use them - Unity actually saves the tag index in the GameObject, not the string, thus defining a tag at runtime will not work unless it has been previously defined in the Tag Manager.