APawn::ReceiveCon trollerChanged
#include "GameFramework/Pawn.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEvent
Description
Blueprint event called after the pawn's controller changes, on both the server and owning client. Fired at the same time as the `ReceiveControllerChangedDelegate`.
Caveats & Gotchas
- • Unlike `ReceivePossessed`/`ReceiveUnpossessed`, this event fires on the owning client as well as the server, making it the right choice for client-side reactions to controller changes.
- • Both parameters can be null — on first possession `OldController` is null; on final unpossession `NewController` is null. Always null-check before dereferencing.
Signature
void ReceiveControllerChanged(AController* OldController, AController* NewController) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OldController | AController* | The controller that previously owned this pawn (may be null). | — |
| NewController | AController* | The controller that now owns this pawn (may be null). | — |
Return Type
void Example
Blueprint: update UI for new controller text
Event ReceiveControllerChanged(OldController, NewController)
→ Branch (NewController != None)
→ [True] Cast To PlayerController → Show HUD Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?