My respawn system does not work

I made this script so when i collide with a object, i get teleportet back to my spawn point.
But it does not work, what is wrong with the script?

 #pragma strict
    
    function OnCollisionEnter(collision : Collision) {
    
      if (collision.gameObject.tag == "Wall")
      
      transform.position.x = -0.08707774;
      transform.position.y = -3.114533;
      
      }

Is the Wall Tagged “Wall” or just named?

Both objects have rigidbodies and colliders?

Also, your if statement is missing braces.

if (collision.gameObject.tag == "Wall")
 {
      transform.position.x = -0.08707774;
      transform.position.y = -3.114533;
 }