restore position of the player when collider with other object?

I'm creating a game, and i need that when the FPC collide with the object "enemy", the FPC return the start position.

I tought this would be a simple task, but after I tried the following code, and it didnt work, I just dont know what to do anymore.

function OnControllerColliderHit(hit:ControllerColliderHit) 
{
      if ((hit.gameObject.tag == "enemy")) 
      {
               transform.position = new Vector3(7,1,93);
               Debug.Log(transform.position);
         }
}

If anyone can help me, I will be very gratefull, Thx for your time, Anderson

Try this script: It's akin to your's but with one modification; you need to have an empty gameObject for the respawn point.

var spawnPoint : GameObject;

function OnControllerColliderHit(hit:ControllerColliderHit) 
{
      if ((hit.gameObject.tag == "enemy")) 
      {
               transform.position = spawnPoint.transform.position;
               Debug.Log("You were successfully respawned");
         }
}

Drag your spawnpoint onto the slot in the inspector. Hope this helps!

I tried this script but it did not work, my teacher taught me this script.but now I do not collide with the character I go with him and that I teleport to the start point.

function OnTriggerEnter(hit:Collider)
{   
    if ((hit.gameObject.tag == "enemy"))
    {   
        Debug.Log(transform.position);
        var go : GameObject = GameObject.FindWithTag("respawn");
        transform.position.x = go.transform.position.x;
        transform.position.y = go.transform.position.y;
        transform.position.z = go.transform.position.z;
    }
}

but thx for your help.