RealDocs

APlayerState::EngineMessageClass

property Engine Since 4.0
#include "GameFramework/PlayerState.h"
Access: public Specifiers: UPROPERTY

Description

The ULocalMessage subclass used to broadcast game-agnostic messages such as player-entered and player-left notifications. Defaults to UEngineMessage.

Caveats & Gotchas

  • This property is not replicated — if you change it, do so on the server only (or consistently everywhere). Mismatches between server and clients won't cause crashes, since message dispatch happens server-side.
  • Changing this affects all players because the ShouldBroadCastWelcomeMessage and ClientInitialize paths both route through this class. Override it in your APlayerState subclass constructor if you want custom join/leave messages.

Signature

UPROPERTY()
TSubclassOf<class ULocalMessage> EngineMessageClass;

Example

Use a custom message class C++
AMyPlayerState::AMyPlayerState(const FObjectInitializer& OI)
    : Super(OI)
{
    EngineMessageClass = UMyCustomMessage::StaticClass();
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.