Collision by tag issues

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.

I’m a C# programmer myself but this doesn’t seem right:

if (collision.gameObject.tag == “PlayerTrigger”); <— this semicolon :slight_smile:

edit: just to be clear, you should open curly brackets here and close it after the next two lines.