Skip to main content

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

  1. Create a new Widget Blueprint (or open an existing HUD widget)
  2. In the Palette, search for CometChat Group Chat Box
  3. Drag it onto your canvas
  4. In the Details panel, fill in the config properties:
  1. Play — the widget handles everything automatically

C++


How It Works

When the widget is constructed, it runs an automatic flow:
The widget shows a loading overlay during each step (“Configuring…”, “Logging in…”, “Joining group…”, “Loading messages…”) and transitions to the chat view once ready.

Widget Structure

The widget builds its entire UI programmatically in C++ — no Blueprint designer layout needed.
Each message row contains:
  • 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 a UPROPERTY — 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 to OnMessageReceived on the UCometChatSubsystem. When a new group message arrives:
  1. It checks if the message belongs to the configured GroupGuid
  2. It filters out messages sent by the current user (to avoid duplicates — sent messages are already added on send)
  3. It creates a new message row and scrolls to the bottom
No additional wiring needed.

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.