How can I solve the question of mouse direction and player move direction in FPS game

Recently, I have tried to make a FPS simple game including, player + camera.

First of all, I make a script for controlling in Mouse.

and a script for controlling player movement.

At first, player and camera face the same direction; therefore I use vertical button to controller player.
But When I turn my mouse to the right direction, even though, Camera and player face the same direction, however, vertical button no longer controlled my player. I have to use horizontal button to control my player to move forward or backward.

Is that related to TransformDIrection or localRotation?, I am confused by the question.
By the way, I have searched for many video solving this problems by using rigidbody attribution.
And I use Character Controller attribution. Does it matter?
Thanks~

Best way forward is to show your current code so others can better see what’s wrong here

the part in particular id want to see is the getkey inputs

OK, I use transform.TransformDirection to solve this problem, thanks~