How to create an offset for camerafocus based on camera rotation?

Hey there,

I’m making a third person camera system (math based) and I want to kinda of apply an offset to the focus of the camera, but the offset has to move to the right of the hrp when the camera is on the right of the character and the same thing for the left. I think i can use dot product for it but I’m not sure how…

Blue represents camera, red represents offset. Black dot is the player.

Thanks in advance!