Camera position

This must have been asked a thousand times, as it’s pretty basic. But I’m not able to grasp it.
So I’m trying a seemingly simple control scheme here. The player uses a joypad, with the left analog stick the character moves forward/backward and sidesteps. The right analog stick is supposed to rotate the camera + character along the character’s up direction, and moving the analog stick upwards rotates the camera along the right axis of the character.
I’ve been trying to create a system that saves the direction of the camera and the distance to the player, but I can’t make it seem to work.
How would I best go about this?

Import the Character Controller package and take a look at the MouseLook script. You will need to adapt it a bit to replace the mouse input by the analog stick input, but otherwise it’s seems similar.

Then, attach that script to the player and parent the camera to him.