RealDocs

APlayerState::IsInactive

function Engine Since 4.0
#include "GameFramework/PlayerState.h"
Access: public

Description

Returns whether this PlayerState came from the GameMode's InactivePlayerArray, meaning the player has disconnected and the state is being preserved for a potential reconnect.

Caveats & Gotchas

  • Inactive PlayerStates are still actors in the world; code that iterates GameState->PlayerArray will not see them, but they exist until destroyed or the player reconnects — ensure your systems handle the case where a PlayerState is inactive.
  • bIsInactive is replicated via OnRep_bIsInactive so clients can display 'disconnected' indicators, but clients can only read it — they cannot set it.

Signature

bool IsInactive() const

Return Type

bool

Example

Show disconnected indicator on scoreboard C++
for (APlayerState* PS : AllTrackedPlayers)
{
    ScoreboardRow->SetDisconnected(PS->IsInactive());
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.