Altering TextChatMessages after posting

I’m attempting to port over from LegacyChat and I’m having trouble finding a solution to the following:

When a character goes invisible after saying something in chat, I can’t access the existing bubble chat to remove it. With legacy chat all the chat UIs were public, but with TextChatService, even with access to the “TextChatMessage” instances, they are immutable and cannot be removed or hidden by any method I have searched for. Is there a way to remove a bubble chat after it is already sent? Is there a way to alter a message at all after it has been sent?

You can try this solution on another post:

This is for legacy chat. The GUIs seem to be internal for TextChatService

The only solution I found was overriding the OnBubbleAdded callback and setting the TextMessage’s BubbleChatMessageProperties property

TextChatService.OnBubbleAdded = function(message, adornee)
	if isInvisible then
		local props = Instance.new("BubbleChatMessageProperties")
		props.TextSize = 0
		props.BackgroundTransparency = 1
		message.BubbleChatMessageProperties = props
	end
end

or I guess you can just toggle the Enabled property on BubbleChatConfiguration lol

That only works for hiding text posted as the invisible person speaks. I need it to go invisible after it is posted.

Could create an attachment or custom part to adornee the bubblechat to, and set this part/attachment very far below the map when needed to hide the message?

1 Like

This is what I ended up doing. Trick is that if the specified adornee doesn’t exist on a character it defaults to humanoidrootpart, so even characters without the attachment are safe.