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?
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
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?
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.