A concept I am working on uses W,A,S,D for movement and sometimes the camera will be oriented so that the game is side scrolling, where D is forward (moving right), but other times the camera might be behind the player looking forward (Kinda like 3rd person) and In this case, W would need to be forward.
Currently I only have it set up where D is always forward but it gets highly confusing when the camera angle changes at a certain parts.
Is there a simple enough way to figure out how to determine which key would be appropriate for forward? I kinda think of it like making the keys act analogue or something like that, but can't think of a good way. Maybe something like the closer the cameras forward direction is to the players forward direction, interpolate key inputs to match axis?
Also, my camera is following on a spline path so when the direction its looking at the player changes, its not immediately 3rd person. It eases into that, so to make this more complicated, I would think that sometimes a combination of two keys would be forward (D to D&W to W)
Sorry if this is common but I couldn't figure out what to search for.
Edit: I didnt include the detail that its not purely left/right for the side scrolling part, the character can go in all 4 directions (+X,-X,+Y,-Y) but is limited by a small path. Space would be my jump. See pic below: