APawn::IsControlled
Deprecated: IsControlled is deprecated. To check if this pawn is controlled by anything, call IsPawnControlled. To check if this pawn is controlled only by the player, call IsPlayerControlled.
#include "GameFramework/Pawn.h"
Access: public
Specifiers: BlueprintCallable
Description
Returns true if the pawn currently has a valid controller. Deprecated since 4.24 — use IsPawnControlled() to check for any controller, or IsPlayerControlled() to check for a human player specifically.
Caveats & Gotchas
- • Deprecated since UE 4.24. Calling this will produce a compile-time deprecation warning; migrate to IsPawnControlled() (any controller) or IsPlayerControlled() (human players only) depending on your intent.
- • The old function did not distinguish between AI and player controllers; the ambiguity is why it was replaced with two more explicit alternatives.
Signature
ENGINE_API bool IsControlled() const; Return Type
bool Examples
Branch on whether this pawn is controlled (deprecated — prefer Is Pawn Controlled)
Blueprint
Migrating away from IsControlled C++
// Old (deprecated):
// if (MyPawn->IsControlled()) { ... }
// New — check for any controller (AI or player):
if (MyPawn->IsPawnControlled()) { /* has any controller */ }
// New — check for human player only:
if (MyPawn->IsPlayerControlled()) { /* controlled by a player */ } Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | deprecated | — |
| 4.24 | deprecated | Deprecated in 4.24. Use IsPawnControlled() or IsPlayerControlled() instead. |
Feedback
Was this helpful?