Spectator - automatically switch to the next player

Hello,

I would like to implement following feature:

1.Player A just died and now he is spectating Player B.

2.Player B dies

3.Player A is automatically switched to spectate another Player

Instead of point 3 my spectator just goes into FreeCam state.

I am using standard code to start spectating:

	PlayerState->bIsSpectator = true;
	PlayerState->bOnlySpectator = true;

	ChangeState(NAME_Spectating);
	ClientGotoState(NAME_Spectating);

	ServerViewNextPlayer();

Is there an UE4 built-in mechanism to use to have Player A automatically switched to spectate another Player?

Can I somehow listen for event when player, which I am spectating, dies?

1 Like