It is weird, I just duplicate your copy in my project and the camera flip 180 when the character change its direction. Maybe in your code, you aren’t rotating your character and attaching the camera works as you expected.
Instead of attaching you can:
- Use a SpringArmComponent with a CameraComponent and in Camera Settings disable Inherit Yaw
- Create a follow code in your camera blueprint