Hi,
I am trying to make a player spectator. I have my own spectatorpawn class and I just do this in the playercontroller class :
void ATestCopyModelPlayerController::SwitchToSpectator(bool bIsSpec)
{
if (bIsSpec)
{
SetSpectator(true);
APawn* lastPawn = GetPawn();
this->ChangeState(NAME_Spectating);
if (lastPawn != NULL)lastPawn->K2_DestroyActor();
this->ClientGotoState(NAME_Spectating);
//Possess(GetSpectatorPawn());
}
else
{
/*SetSpectator(false);
APawn* lastPawn = GetPawn();
this->ChangeState(NAME_Playing);
if (lastPawn != NULL)lastPawn->K2_DestroyActor();
this->ClientGotoState(NAME_Playing);*/
//not implemented yet
}
}
It is started from the gamemode (the authority) and after this I wait a second and call the Possess(GetSpectatorPawn()). My authority get the pawn and everything works but the clients only change state they don’t get any pawn (getpawn() == NULL).
What could be wrong ?
rXp