It so happens I don’t want a stray bullet to go through walls and activate a spawn enemy trigger - or something. So I looked into the tag solution. But I am missing something :
var someString : String;
@script AddComponentMenu("Gameplay/Trigger Message")
function OnTriggerEnter (collision : Collider) {
if (collision.gameObject.tag == "PlayerTrigger");
MessageList.Instance().AddMessage(someString);
Destroy (gameObject);
}
The PlayerTrigger is a colider in the player gameObject hierarchy. The projectile has a Projectile tag itself. Yet, shooting the trigger will just, well, trigger it.