First, of course, you have to set up tags on objects (for how, go here: [Unity tags Info][1]),
After you set up your tag, you can access the name of the tag in an **OnTriggerEnter** function:
function OnTriggerEnter(col : Collider) {
if(col.gameObject.tag == "nameOfYourTag"){
//Do Something
}
}
[1]: http://unity3d.com/support/documentation/Components/Tags.html
↧