Looks like OnWindowFocusChanged is doing the trick. Found it via:
I have put UGameplayStatics::SetGamePaused(GetWorld(), true); instead of setting the max fps.
Just make sure to add the following includes:
include <Kismet/GameplayStatics.h> include “Framework/Application/SlateApplication.h”
and you can put this in any component for example. I put it in a dedicated component that I added to my character blueprint and it seems to work as intended. It pauses when alt tabbing and unpauses when going back