Infinity Hallway

Hi everyone,I’d like to know if its possible to make an “infinite” hallway. Meaning, Make the player think hes going through a really long hallway but really the player is just being teleported back to the middle of it without the player noticing. Is this possible?
Please and Thank You.

No problem: use a trigger (more versatile) or just compare coordinates (needs an axis aligned hallway), then subtract the appropriate fixed distance from the player position:

// hallway aligned to world Z axis
var distance: float = 50; // the distance is the exact size of the hallway module

function Update(){
  if (transform.position.z > initPos.z + distance){
    transform.position.z -= distance;
  }
  if (transform.position.z < initPos.z){
    transform.position.z += distance;
  }
}

You must have a hallway module and repeat it enough times ahead and behind the center position, and distance must be set to the module length.