In-Experience Text Chat

The in-experience text chat system powered by TextChatService allows users to easily communicate and socialize with each other in live experiences. In addition to supporting the default text chat, you can customize the front-end user interface (UI) to improve your user engagement and immersion.

Chat Window Configuration

You can toggle appearance of the chat window and input bar in one of two ways:

  • Directly in Studio by toggling the Enabled property of the service's ChatWindowConfiguration and ChatInputBarConfiguration children.

  • Through scripting, from a LocalScript within StarterPlayerScripts.


    local TextChatService = game:GetService("TextChatService")
    local chatWindowConfiguration = TextChatService:FindFirstChildOfClass("ChatWindowConfiguration")
    local chatInputBarConfiguration = TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration")
    if chatWindowConfiguration then
    chatWindowConfiguration.Enabled = true
    if chatInputBarConfiguration then
    chatInputBarConfiguration.Enabled = true

Chat Window Customization

You can customize the default chat window to match your experience’s UI layout, design, and style by using the following properties in Studio:

BackgroundColor3Background color of the chat window in Color3.[25, 27, 29]
BackgroundTransparencyTransparency of the chat window.0.3
FontFaceFont of chat text displayed on the chat window.Font.GothamMedium
TextColor3Color of chat text displayed on the chat window in Color3.[255, 255, 255]
TextSizeSize of chat text displayed on the chat window.14
TextStrokeColor3Chat text stroke color displayed on the chat window in Color3.[0, 0, 0]
TextStrokeTransparencyTransparency of chat text stroke displayed on the chat window.0.5
HeightScaleHeight scale of the chat window relative to the screen size.1
WidthScaleWidth scale of the chat window relative to the screen size.1

Customizing Message Appearance

You can customize the appearance of chat message bodies and prefixes using rich text tags and TextChatService.OnIncomingMessage callbacks without overriding the existing UI. The customization options let you modify the appearance of chat messages to match your experience's theme, and you can also sort or highlight messages from different user groups by adding chat tags and coloring usernames.

Adding Chat Tags

If your experience has users with special attributes like VIP status, you can attach chat tags wrapped in brackets to the front of user messages to highlight their chat messages. The following LocalScript in StarterPlayerScripts examines all Player instances representing users in your experience and appends VIP chat tags for those with the IsVIP attribute.


local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")
TextChatService.OnIncomingMessage = function(message: TextChatMessage)
local properties ="TextChatMessageProperties")
if message.TextSource then
local player = Players:GetPlayerByUserId(message.TextSource.UserId)
if player:GetAttribute("IsVIP") then
properties.PrefixText = "<font color='#F5CD30'>[VIP]</font> " .. message.PrefixText
return properties
VIP users' chat tags

Coloring Usernames

When a user sends a chat message, their username displays as the prefix portion of the message. By default, each user's name is colored according to their TeamColor but you can change the colors of chat usernames using TextChatService.OnIncomingMessage and font color tags. The following LocalScript in StarterPlayerScripts assigns a predetermined color to each user, picking randomly from a table of RGB colors.


local TextChatService = game:GetService("TextChatService")
local nameColors = {
Color3.fromRGB(255, 0, 0),
Color3.fromRGB(0, 255, 0),
Color3.fromRGB(0, 0, 255),
Color3.fromRGB(255, 255, 0),
TextChatService.OnIncomingMessage = function(textChatMessage: TextChatMessage)
local properties ="TextChatMessageProperties")
local textSource = textChatMessage.TextSource
if textSource then
local index: number = (textSource.UserId % #nameColors) + 1
local randomColor: Color3 = nameColors[index]
properties.PrefixText = string.format("<font color='#%s'>%s</font>", randomColor:ToHex(), textChatMessage.PrefixText)
return properties

Adding Chat Bubbles

In addition to displaying messages on the chat window, you can support the display of customizable chat bubbles above user avatars for immersive engagement.

To enable and customize bubble chat in your experience:

  1. In the Explorer window, select BubbleChatConfiguration under TextChatService.

  2. In the Properties window, check the Enabled checkbox under the Behavior category.

  3. Customize the Appearance and Behavior properties of bubbles in the same Properties window.

Chat Bubbles Customization

The following table shows common properties that you can adjust to customize the basic bubble appearance and behavior. For a full list of customization properties, see BubbleChatConfiguration.

BackgroundColor3Background color of bubbles in Color3.[250, 250, 250]
FontFont of the bubble text.Font.GothamMedium
TextColor3Color of bubble text in Color3.[57, 59, 61]
TextSizeSize of bubble text.16
EnabledA checkbox indicating whether bubble chat is enabled in the experience. True (Checked)
AdorneeNameString name of the body part or Attachment that bubbles attach to; if multiple instances of the same name exist, the system attaches to the first instance found."HumanoidRootPart"
BubbleDurationTime before a bubble fades out, in seconds.30
BubblesSpacingVertical space between stacked bubbles, in pixels.6
LocalPlayerStudsOffsetIf adorned to the local player, the offset of bubbles in studs from their adornee, relative to the camera orientation (Vector3).(0, 0, 0)
MaxDistanceMaximum distance from the camera that bubbles are shown.100
MinimizeDistanceDistance from the camera when bubbles turn into a single bubble with an ellipsis () to indicate chatter.40
VerticalStudsOffsetExtra space between bubbles and their adornee, in studs.0