Make gameobject appear on collision

This is the unityscript that I am using so that my enemy will appear when I collide with something. The problem is that it does absolutely nothing! The enemy(smiledog) appears right away and nothing happens when I collide with the object. I’ve selected the gameobject for the script and everything.

collider.isTrigger = true;

var smiledog : GameObject;
function OnTriggerEnter ( other : Collider) {
    Instantiate (smiledog);
}

You might need to specify which collider needs to trigger the instantiation.

OnTriggerEnter…

if(Collider.name == “Player”)
{
Instantiate…
}

or check against the tag of the collider