AGameModeBase::K2_OnChangeName
#include "GameFramework/GameModeBase.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEvent
Description
Blueprint event fired by ChangeName after a player's name has been updated. Override this in a Blueprint GameMode subclass to react to name changes, such as sending a chat notification or logging the event.
Caveats & Gotchas
- • This is a BlueprintImplementableEvent — it has no C++ base implementation. If you override it in a Blueprint subclass of GameMode, it will fire; otherwise it does nothing.
- • To override in C++ instead, override ChangeName() directly and add your logic before or after the Super call rather than implementing K2_OnChangeName.
- • Fires server-side only — GameMode does not exist on clients, so this event will never fire on a connected client machine.
Signature
ENGINE_API void K2_OnChangeName(AController* Other, const FString& NewName, bool bNameChange); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Other | AController* | The controller of the player whose name changed. | — |
| NewName | const FString& | The new name that was assigned. | — |
| bNameChange | bool | True if the player already had a name and it changed; false if this is the first name assignment. | — |
Return Type
void Example
Blueprint: react to a name change text
// In Blueprint GameMode subclass, implement the OnChangeName event:
// Event OnChangeName (Other, NewName, bNameChange)
// -> Branch: bNameChange is True
// -> Print String: 'Player renamed to ' + NewName Version History
Introduced in: 4.14
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?