Rotate camera if player is about to go out of its view?

thanks, i’ll try to work with this one as well.