unity ontriggerenter always is on? code example

Example 1: ontriggerenter unity not working

void OnTriggerEnter (Collider other)
     {
         if (other.gameObject.tag == "Object") 
         {
             Debug.Log ("Collided");
         }
  
//at least one object needs a rigidbody, and a collider set to isTrigger.
//the problem may be that you put it in a void, you need to take it out of voids for it to work

Example 2: respawn ontriggerenter unity code

var spawn : GameObject;    function OnTriggerEnter(other : Collider) {     if (other.tag == "FirstPerson-AIO")     {         other.gameObject.position = spawn.transform.position;     } }