APlayerState::IsABot
#include "GameFramework/PlayerState.h"
Access: public
Specifiers: UFUNCTIONBlueprintGetter
Description
Returns whether this PlayerState belongs to an AI-controlled bot rather than a human player.
Caveats & Gotchas
- • bIsABot is set to true when the PlayerState is associated with an AIController — it reflects controller type, not whether the player is human. A human player driving an AI-ish controller will not be flagged unless SetIsABot is called explicitly.
- • The flag is replicated so clients can correctly distinguish bots from humans on scoreboards and in UI, but there is the usual replication latency before it is accurate on all clients.
Signature
bool IsABot() const Return Type
bool Example
Exclude bots from a human-only leaderboard C++
for (APlayerState* PS : GameState->PlayerArray)
{
if (!PS->IsABot())
{
Leaderboard.Add(PS);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?