Restrict movement within the volume

Are you just trying to stop the player from stepping on the wooden walls?

Is this restricted motion thing relative to the world or the player? If that wall was pointing north/south, would you want to stop them moving left/right?