Make any engine vertical by adding "vertical_engine" tag to it in the editor.
Also functional tags for vertical engine:
"only_upwards" - engine can push sub only up,
"only_downwards" - engine can push sub only down.
Example test-sub: Green Scavenger
C# version by Nupaska
If you have trouble setting up vertical engine check if engine gives horizontal thrust, if it does you probably don't have lua or this mod installed. Otherwise add more maximum force on engine.
https://steamcommunity.com/workshop/filedetails/?id=2559634234
Lua For Barotrauma is requied for server side as well as client side
HOW TO INSTALL LUA FOR BAROTRAUMA[evilfactory.github.io]
This mod was approved by Elon Musk