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;
}