How to make bubble chat overhead always on top

In my game, players have an overhead username, stats and more but the bubble chat is always behind it.
I tried setting the overhead billboardui’s alwaysontop to false, but then it just goes darker and lighter when facing the oposite way of sun.

How do I make the bubble chat be in front of overhead ui’s without having the ui’s overhead be so dark.

1 Like

You can do something like Adopt Me, where it hides the overhead GUIs while the player has a bubble above their head. I can help you write a script for that if you’d like.

Sure, that’d be great but if there’s a way you can make the overhead UI’s stay and make bubble chat in front then that’s cool!

Discord: .kinglycidas
add me and yeah

Technically you could move the overhead guis to a position above the bubble, but that would most likely be complicated and unreliable since the only way I can think of doing that is checking the length of the message and somehow calculating the average character length of one line and moving the uis upward by however tall one line is, but of course symbols and emojis might break that so I think the most reasonable solution would be to hide them.

You could do something like this:

game:GetService("Players").PlayerAdded:Connect(function(Player)
  local BillboardGui = --(put the path to the billboard gui here)
  Player.PlayerChatted:Connect(function()
    for _, Gui in BillboardGui:GetChildren() do
      Gui.Visible = false
    end
    wait(30) -- You can also use task.wait(), although I usually use wait()
    for _, Gui in BillboardGui:GetChildren() do
      Gui.Visible = true
    end
  end)
end)

I’m pretty sure the length of a bubble’s lifespan is 30 seconds, but you can change the wait as needed if I’m wrong.

BubbleChatConfiguration.BubbleDuration


--// (assuming the over-head billboard is variabled 'overhead')

local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
   player.Chatted:Connect(function(message)
      overhead.Enabled = not true
      task.delay( ( TextChatService.BubbleChatConfiguration.BubbleDuration ), function()
         overhead.Enabled = true
      end)
   end)
end)

probably doesn’t work but hopefully it has a better structure

1 Like