You can try adding an object as a camera tracker then center the camera on that tracker instead of your player, so calculate the distance between the player and the tracker and it’s X/Y and move the tracker down/up when you need so the camera will always follow the tracker.
Here an extension that maybe helps