Hi all, it appears that the new bubble chat is having a similar issue that I reported back in October of 2019: Appearing too far off to the side when the camera is close to the player and not centered on the humanoid root part. Examples:
My bug report for the old bubble chat’s issue was met with the temporary solution of forking the corescript and changing the function SetBillboardLODNear, here:
I have attempted this solution with the new corescript and saw no visual change.
This fix is important because Bubble chat is the primary form of communication in my game (No default chat outside of testing), and your own chats being drawn incorrectly detracts massively from the experience. Thank you for reading.
Thanks for the report! I can provide some context here. As you said this behavior was copied over from the old bubble chat and the reason it was there in the first place is that some large hats can cover chat bubbles, which we fix by moving the billboard UI 2 studs forwards on the Z axis for the local player in this line : billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0.1)
Due to how the API is designed, adding a StudsOffset to the Z axis will also make the billboard move sideways only if it is not centered on the screen. I understand now that this behavior is undesirable for your use case of over-shoulder camera so I will see if we can add some sort of toggle for this behavior as a customization setting in the Chat:SetBubbleChatSettings API.
This is still an issue 3 months later with no known fix in sight.
For some reason, changing billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0.1) does not work either - despite the custom BubbleChat script overwriting the default one.
Apologies for the long delay! Happy to announce that the customization setting I mentioned in my above reply was implemented as part of the recently shipped Brand New Bubble Chat Customizations.
Adding the below line to a LocalScript should fix this behavior now. Please let me know if there’s any issue!
Thanks for asking, forgot to clarify that! The default value for LocalPlayerStudsOffset is Vector3.new(0, 0, 2) and it is recommended to keep it that way because that prevents large avatar items from obstructing the chat bubbles. However, due to how billboard GUIs work, this will result in them becoming off-centered when the character is not centered on the screen, which is the case when using a custom camera like this, so I would recommend applying this fix only in this scenario.
Could you not fix this by, instead of using a fixed LocalPlayerStudsOffset as you do currently, calculating it based on the position of the chat bubble relative to the camera? Something like this:
local bubblePos = Vector3.new(...)
local cameraPos = workspace.CurrentCamera.CFrame.Position
local bubbleToCameraDir = (cameraPos - bubblePos).Unit
local offsetWorldSpace = bubbleToCameraDir * 2
Here’s the logic - given some original point, you can find a line between the point and the camera position. Sliding that point along that line won’t change the position of the point on-screen, only it’s distance from the camera. Therefore, to make the bubble appear in front of large accessories without changing it’s apparent position on screen, you can slide the bubble closer to the camera along that line.