Look somewhere and enviroment changes

you look at the hallway and realize
it’s a dead end, you turn around and
suddenly there’s a wall behind you.

I think I misunderstood it somehow, my bad. In this case it’d would be a matter of the player entering a collision volume that spawns something behind them.

but making it so when looking at a
specific location triggers a change?

You can trace, when the trace hits the sweet spot, you replace whatever is behind the player. Ideally, you combine the 2. You start tracing when the player is in a specific volume.