PubNub Text Chat
Text chat between the web and in event experience
Overview
The ability to chat on web and in game, including:
Chat from Web to Unreal and back
Works on Desktop and Mobile*
Text appears in game above the head
Ability to hide and show the widget, and custom sizing
User name and profile image appending to the message
The in-and-out-experience chat is backed by PubNub. For battle-tested, in-experience only chat, see Experience Only Chat.
Integration
Make sure you have a safe internal world id set up for your editor users.
Configure the variable
Social.Chat.Editor.Worldindeployment.jsonwith this value (see below)
How to enable
Enable
TextChat.UseCloudChatingame.json.Make sure your in-game HUD is set up to use the new chat system
The following settings in game.json influence the Text Chat feature:
Setting
Description
Default Value
TextChat.UseCloudChat
Enables the cloud chat functionality
true
TextChat.ForceMobileView
Forces mobile view regardless of detected platform
false
How to enable Text chat in Editor
The steps taken will depend on your sign-in settings. Navigate to Editor Preferences > General > Sign in Settings. If Use Local World For PIE is enabled then follow the instructions for using a local world below. By default, this setting should be true.
If you are using local world sign in then nothing needs to be done. You will automatically be configured a chat channel named after your users unique local world Id.
Create a deployment.override.json in your project live config directory (Config/LiveConfig/Overrides) and add the following, replacing the World value with any unique name for your chat channel.\
Live Config configuration
The following deployment.json live config fields influence the Text Chat feature:
Social.Chat.WorldSource
Determines how the client should determine the world id to use for chat.
The values are as follows:
Domain- Uses the currentWorldIdvalue of the Domain Configuration Subsystem. This can change per-player at runtime. Therefore a single users chat channel can change during the game. For example if the player world travels.LiveConfig- Uses theSocial.Chat.Worldvalue. As a live config value this can be changed for all players by modifying the live config settings via the dashboard.CommandLine- Uses the client cli launch arguments. These are static throughout gameplay for each client and therefore even if you world travel, clients will continue to use the same chat channel
Domain
Social.Chat.World
This is a generic, hard coded chat channel name.
It is named "World" because the other sources will use the world Id however any unique name could be used as the chat channel
Only used when Social.Chat.WorldSource is set to LiveConfig.
Empty
Social.Chat.Editor.WorldSource
Exactly the same as Social.Chat.WorldSource but used when in the Editor. For example in Play-in-Editor (PIE) scenarios.
The default value will only work if you are signing in with a local world. If you are not using a local world, you should change this value.
Domain
Social.Chat.Editor.World
Exactly the same as Social.Chat.World but used when in the Editor. For example in Play-in-Editor (PIE) scenarios.
Only used when Social.Chat.Editor.WorldSource is set to LiveConfig.
Empty
M2.Domains.WorldId
(LEGACY)
The world id in the web to scope the chat to.
This must match the web portals if you want cross-experience chat.
Adding Chat to your HUD
Add WBP_M2_TextChat to your HUD and ensure it is stretched across the whole screen.
Adding Mobile Support
WBP_M2_TextChat does not yet support mobile platforms. If your HUD is or derives from WBP_TH_HUD then your good to go. Otherwise follow the below steps:
Use a widget switcher to switch between WBP_M2_TextChat and WBP_TextChatWindow_Mobile with the following code to allow it to automatically revert to the old UI for mobile devices.
On Bootflow finished, add a handle to get live config updates.

Create a function called Update Live Config and add the following:

Full Live Config Setting List
Settings marked (LEGACY) may be removed in a future update
TextChat.GlobalChatEnabled
Enables the Global Chat channel
true
TextChat.UseCloudChat
Enables use of the cloud based chat system, linking the in game chat with web chat
true
TextChat.ForceMobileView
Forces the old Chat UI (WBP_TextChatWindow_Mobile) to a full screen mobile view, regardless of platform or device used
false
TextChat.ForceMobileUI
Force the old Chat UI (WBP_TextChatWindow_Mobile) to be used over the new WBP_M2_TextChat regardless of platform or device used
false
TextChat.StartMinimized
Sets the chat interfaces to start in a minimized state
true
TextChat.EmojiMenuEnabled
Enables the in game emoji menu to be used. Only supported in WBP_M2_TextChat
true
TextChat.ReactionsEnabled
Enables message reactions. Still WIP, not yet supported in Origin
false
TextChat.MaxHistoryMessages
Max messages to be displayed in the chat interface
100
TextChat.LocalChatEnabled
(LEGACY)
Enables Local chat functionality for Experience only chat
true
TextChat.LocalRateLimitPerSecond
(LEGACY)
Maximum number of messages a player can send per second
10
TextChat.LocalRateLimitQueueSize
(LEGACY)
Defines the message queue size for the local chat server
100
TextChat.AllowQuestions
(LEGACY)
Allows questions to be sent in chat
false
Last updated
Was this helpful?

