How can I make it so a character can only move in 1 direction(right)?

This part of my game takes place in long hallway, and I would like to make it so the player can only walk to the right. Not up, left, or down. Does anybody know how I could make this happen?
Pic related for visuals on what I mean. Hopefully it's understandable.
1847091793122.png
Plugin solution: YEP Yanfly region restrictions: simply add upper and lower lines as non walkable regions, defined in the plugin.

Alternative A: alter a B/E tileset to have a transparent tile, assign that tile as X (non-walkable) Proceed to lock out above and below paths with those tiles.

Alternative B: in case you need the tiles and cant afford to put one as transparent for mapping purposes you can put empty "same as player" events in the upper and lower rows so you lock the player into the linear path.
Hmmm... The way I see it, If the player isn't even allowed to move back the way he came from, why not just make him move automatically via set path? I don't see a reason for the player to be controlling this himself when the only possible choice is right.
Plugin solution: YEP Yanfly region restrictions: simply add upper and lower lines as non walkable regions, defined in the plugin.

Alternative A: alter a B/E tileset to have a transparent tile, assign that tile as X (non-walkable) Proceed to lock out above and below paths with those tiles.

Alternative B: in case you need the tiles and cant afford to put one as transparent for mapping purposes you can put empty "same as player" events in the upper and lower rows so you lock the player into the linear path.
Thanks for the ideas! I ended up going with your 2nd idea of making 2 rows of same as player events, and in the middle row every event would activate a self switch upon player touch, so the box behind them blocks them from going back.
Hello welcome!

You can create a graphic-free collision event that is always behind the player:
Create a map event in parallel process:
Code:
◆Control Variables:#0011 X-Block = Map X of Player
◆Control Variables:#0012 Y-Block = Map X of Player
◆Control Variables:#0011 X-Block -= 1
◆Set Event Location:This Event, ({X-Block},{Y-Block})
◆Wait:10fps

Good luck!

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-it-so-a-character-can-only-move-in-1-direction-right.141120/