Hi, thanks for reporting. @BackspaceRGB is correct–to display a message for an NPC, you should specify a part like its head. We’ll make the documentation clearer to reflect this.
Hey no that is still a problem because if you specify just the head part you can’t make the chat bubble avoid accessories like it would if you specified the whole character. Sorry I should have mentioned that in my original post - that was the main reason I wanted to use the character rather than just the head part, which I was already aware of.
At the moment, if we want to avoid accessories, we have to do janky stuff like create an invisible part, weld it to the head, and manually compute the bounding box of the accessories and use that to set the size of chat bubble part welded to the head. This is annoying, and also inaccurate because the meshes do not necessarily fill or fit within the part bounding boxes of the accessories. I want to make use of Roblox’s own accessory avoidance code which is probably more efficient and more accurate, and I expected this API to provide that for me.
Thank you for flagging this, I have added in some clarification to the API to say that if you want to display bubbles for NPCs, you must provide a part on the character itself.
I’ll let @Clasifex respond to your specific use case, but again, thank you for flagging a need for more clear guidance here.
This seems like it should be fixed to work on models using the bounding box, rather than just documented as being janky.
If it works for player characters based on the bounding box - why should it not work for other models? Is this exception based on a humanoid existing? Is it only for models that are assigned as a player character?
Agreed that this behavior should ideally be adjusted so the API works as expected for humanoid characters. I filed a ticket in the team’s backlog–however this is currently not a priority for our team so I cannot promise a timeline for when it will be done.
I figured out it works with Chat:Chat() (service named just chat) although its deprecated/ being deprecated even though it’s the only one that actually works.
I’m having this same issue. This just doesn’t work at all NPCs. I can’t find a workaround aside just using the old Chat service’s Chat function, like you said.
Hey, could you post some sample code or an .rbxl? I am unable to reproduce this issue myself
I parented a Script with RunService=Client with the following source:
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
game:GetService("TextChatService"):DisplayBubble(script.Parent, "testing 123")
end
end)
Yeah the API works as expected when called on parts - the repro you attempted was not following the instructions in the OP. The issue is that it doesn’t work on NPC character models (and bubbles on character models behave differently than bubbles on parts, so they aren’t easily interchangeable).
Thanks for prioritizing NPC support! The important part to get right with the Model support is avoiding accessories. When called on real character models, bubble chats avoid visually conflicting with accessories somehow. Calling the API on parts is hard right now because to avoid accessories we need to dynamically resize the adornee part, and come up with our own algorithm for computing the accessory bounding box or whatever (and accessory part bounding boxes don’t match the rendered accessory visuals if I remember correctly).