CometChat Unreal Engine — Sample App (Group Chat Box)
The CometChat plugin ships with a ready-to-use Group Chat Box widget (UCometChatGroupChatBox) that handles the entire chat flow out of the box: configure, login, join group, load history, send messages, and receive messages in real time.
It’s designed as a starting point — use it as-is for quick integration, or as a reference for building your own custom chat UI.
What It Does
Quick Start
Blueprint
- Create a new Widget Blueprint (or open an existing HUD widget)
- In the Palette, search for CometChat Group Chat Box
- Drag it onto your canvas
- In the Details panel, fill in the config properties:
- Play — the widget handles everything automatically
C++
How It Works
When the widget is constructed, it runs an automatic flow:Widget Structure
The widget builds its entire UI programmatically in C++ — no Blueprint designer layout needed.- Avatar — circular with initial letter, loads actual image from URL asynchronously
- Online indicator — green dot on the avatar
- Username — colored differently for self vs others
- Message text — white, auto-wrapping
- Timestamp — gray, right-aligned (HH:MM format)
Customization
Every visual aspect is exposed as aUPROPERTY — editable in the Blueprint Details panel or settable in C++.
Panel
Messages
Avatars
Composer
Send Button
Options Button
Timestamps
Events
The widget exposes one event dispatcher:Blueprint
In the Details panel, find On Options Clicked under Events and click the + to bind it.C++
Real-Time Messages
The widget automatically binds toOnMessageReceived on the UCometChatSubsystem. When a new group message arrives:
- It checks if the message belongs to the configured
GroupGuid - It filters out messages sent by the current user (to avoid duplicates — sent messages are already added on send)
- It creates a new message row and scrolls to the bottom
Loading States
The widget shows an overlay with status text during each phase:
The overlay background color and text style are customizable via the
Overlay properties.