Prevent player from turning/facing up and down

I want to make a side-movement-only game, where the player can only move left and right. Is there any way to prevent the player from even facing up and down? 

Thanks for reading! : ) 
Do a search. I wrote a script (I think for Mr Big T) where he wanted something fairly similar, so you should be able to use the same one.


I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
Whether or not to implement a full overwriting script depends on if you want it to always work or only working in part of the game.

And what you want can easily be done without a script.

If you only want the left right movement only, simply make a line-like moveable tile area on the bottom of the map.

To "force" left and right only, simply change your UP sprite to LEFT and Down sprite to RIGHT.

So your sprite will be :

LEFT

LEFT

RIGHT

RIGHT

But if you want a "platform game" all through the gameplay, with real time gravity and such, a script is easier. 😉
🙂 The script I wrote uses a switch to determine when to active it and when to deactivate it

Original thread: https://forums.rpgmakerweb.com/threads/prevent-player-from-turning-facing-up-and-down.44415/