I made some slight changes to my game, that should in no way influence the spectating state: I created a new c++ class based on HUD, which just adds a Widget to the PlayerScreen on BeginPlay. I selected that HUD class as my default HUD class in my BP_Gamemode and I modified my BirdsEyePawn, so it does not create a Widget anymore.
After I made the changes, when I play in editor with a dedicated server, the client does not spawn the default pawn anymore and spawns the SpectatorPawn instead. When playing with a listen server and a client, the listen server still spawns the default pawn.
These are the relevant logs, when I get the SpecatorPawn instead of my DefaultPawn (BP_BirdsEyePawn):
LogGameMode:Display: Match State Changed from WaitingToStart to InProgress
LogBaseGameMode:Verbose: Spawned Default Pawn 'BP_BirdsEyePawn_C_0' for 'BP_BasePlayerController_C_0'
LogGameState: Match State Changed from WaitingToStart to InProgress
LogBasePlayerController:Verbose: NULL GameState when trying to spawn spectator!
LogSpawn:Warning: SpawnActor failed because no class was specified
LogBasePlayerController:Verbose: Spawned spectator SpectatorPawn_0 [server:0]
The SpawnActor failure seems to be the PlayerCameraManager, because I do not have a PlayerCameraManager Class assigned in my BP_PlayerController, and that Log dissappears, when I assign a PlayerCameraManager class. Weirdly, when I go back to the previous version in Git, the PlayerCameraManager Class is still unassigned, but the SpawnActor failure does not seem to appear.
The other message missing from the logs, when I play with the previous version is that the SpectatorPawn_0 was spawned. So maybe the match state is not correctly replicated to the client?
I am really at a loss about what is going on. Any help or things I could try would be very much appreciated.
If someone from Epic chimes in, I would happily send you a download link to my project. I would prefer to send the download link to an email address or through some other medium, where I don’t have to share the link with the whole internet.