Third person movement similar to Max Payne

Hey everyone!

So basically, I am having a bit of trouble getting the movement in my game to work the way I want it.
I am trying to create a basic game with movement similar to Max Payne for a side project.
The game is similar to Max Payne in that you can walk forwards in the direction the camera is pointing, but you can also walk forwards while aiming left or right, by holding the A or D key to move relative to the rotation of the camera, so it is sort of like strafing, but a bit different.

I hope this makes some sense, but here are some screenshots of the kind of behavior I’m looking for:

This is an example of walking forwards.

And here is an example of walking forwards, whilst aiming in a different direction.

In the case of the second image, I would be holding the A key (or left arrow or whatever it is bound to) so that I am moving to the left of the screen, but I would be aiming to the right of my character, even though that is the center of the screen.

At the moment I am always moving in relation to world space, so that is how I can capture these screenshots, but I have attempted to use transform.TransformDirection to get the desired result, and I can move forward, backward, left and right, except I cannot aim in a different direction, as my entire player character rotates if I move the mouse.

NOTE: I am using C# for scripting.

I am still fairly new to C#, but I should be able to handle most concepts, as I have experience in a few other programming languages, including C++.

I hope this is enough information, and absolutely any help would be greatly appreciated!



I made a bit of progress by adapting the Third Person Input script from the new sample assets, and it lets me move in the desired fashion, but I cannot figure out how to rotate my player’s lower body to face forwards when moving forwards.