Movement messed up because of rotation. How to solve

Does it work ok with the mouse and not the gamepad?