Automatic Rotating Camera

Hey so I want to make a third person camera that moves behind the character like in Battlegrounds. The camera stays behind the character and you can rotate it a little to the sides of the character, but the camera never goes in front of the character. When I hit a key such as Alt i want the camera to rotate freely. Anyone know any tutorials like this? I’ve been stuck on this problem for a while and it’s halted the progress of my first game. Thanks.