Hi There,
I’ve been having trouble getting spectate working when a chararacter dies.
Eg. using a basic 3rd person template. I have it set up so that a line trace hit removes X Dmg, and below X health I call SetLifeSpan(0.001f).
All is well and good, the pawn dies and the player is left with a frozen screen.
So what I’d like to do is spectate the pawn that kills the player.
So I ended up creating a function on the PlayerController called SpectatePlayer(AActor* OtherPlayer)
void AAlphaPlayerController::SpectatePlayer(AActor* Player) {
StartSpectatingOnly();
SetViewTarget(Player);
ServerVerifyViewTarget();
}
I’ve tried a few different ways but this seems to be the closest I can get. It works on the Server (although quite laggy). However on clients the spectator is still frozen in space (it can see the players moving but from the pawns old location).
It seems like it may have something to do with how these methods are called? Like maybe clients don’t have permission to change themselves to a spectator?
Any help is appreciated.