I'm attempting to create a gravity platformer in the style of Super Mario Galaxy for the Wii. I've figured out the gravity mechanic quite well, but the camera player movement has been difficult to implement. I'm using a WASD styled scheme. What I want to happen is that the player should move relative to the viewport (ie. if player presses A the character moves to the left of the viewport. I've come somewhat close in my current build, using a dedicated camera, but when I start changing the camera for different points of view is when things go bad.
I want to be able to switch cameras in-game for design reasons, and whenever the camera isn't exactly in line with the player from the beginning (as how the player-parented one is) the movement goes all out of whack. I've tried this method, but needless to say it doesn't work and is quite outdated. So what I need is for the player to always move in the direction chosen relative to the viewport regardless of how the camera is positioned. If you can't see what I need from this description, download the *.blend file I've provided of my current prototype (tell me if the download breaks). Thanks in advance for any help.
MOUSE: Move player camera
SCROLLWHEEL: Zoom player camera in and out
NUMPAD 0: Switch to stationary camera
NUMPAD 1: Switch back to player camera