Move in the view of the camera

How do you make a character move in the view of the camera?

I am trying to make a game like Zelda and I need the character move in the direction of the camera. How would I go about that?
I have been using python to program his moving. I have a demo game that is uploaded.

Controls


Up = Forward
Down = Backward
Left = Left
Right = Right

Attachments

untitled.blend (318 KB)

You would need to get the camer’as orientation on the global Z-axis and use that as input for moving, it may be a bit hard if you don’t understand matrices. The easier way would be to use the left and right arrows to turn the character and use the up and down arrows to move the character in a local axis, as some may prefer not waiting for the camera to turn to move the player in a direction.

“You would need to get the camer’as orientation on the global Z-axis and use that as input for moving”

how would i do that?