When a PlayerController changes state to Spectating by calling ChangeState(NAME_Spectating)
, there is never a pawn assigned for the controller, so the spectator cannot move around by GetPawn()->AddMovementInput()
calls
When calling ChangeState(NAME_Spectating)
, tracing in the debugger reveals that BeginSpectatingState()
is called which does spawn the spectator pawn, but never calls SetPawn().
A manual call to SetPossess(GetSpectatorPawn())
will eventually make it down to SetPawn()
, but one of the last things OnPossess()
does is Change State to Playing, which reverts the whole spectator process, eventually nullifying the pawn.
Should OnPossess()
be smart enough to know that a spectator pawn is what is being possessed and not assume a Playing state?