APawn::IsPawnControlled
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualBlueprintCallable
Description
Returns true if this pawn currently has a valid Controller of any kind (AI or player). On remote clients this returns false because controllers are not replicated.
Caveats & Gotchas
- • Always returns false on remote clients in a multiplayer game because AController is not replicated to non-owning clients — use HasAuthority() to guard logic that depends on this check.
- • This replaced the deprecated IsControlled() in UE 4.24 and checks any controller type; if you only want to check for a human player, use IsPlayerControlled() instead.
Signature
ENGINE_API virtual bool IsPawnControlled() const; Return Type
bool Examples
Guard server-only logic by confirming this pawn has an active controller
Blueprint
Guard server-only logic that requires a controller C++
void AMyPawn::DoSomething()
{
if (!IsPawnControlled())
{
return; // No controller — nothing to do
}
// Safe to access GetController() here
AController* C = GetController();
} Version History
Introduced in: 4.24
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
| 4.24 | stable | Introduced as a replacement for the deprecated IsControlled(). |
Feedback
Was this helpful?