I am trying to make a custom bubble chat and at the moment I am trying to make the bubbles stack on one another if you type a lot very quickly.

At the moment the Billboard Guis over lap sometimes so my math for changing there offset must be wrong and that is what I am here to find out.

local DeterminedSize = math.clamp(math.ceil(string.len(ChosenNPCDialog) / 18), 1, 3)

for Index, Object in ipairs(NPC:GetChildren()) do
	if Object:IsA("BillboardGui") and Object ~= BubbleGui then
		TweenService:Create(Object, TweenInfo.new(.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {StudsOffsetWorldSpace = Object.StudsOffsetWorldSpace + Vector3.new(0, DeterminedSize, 0)}):Play()
	end
end

DeterminedSize is the height of the newest bubble GUI. It can be between 1 and 3 on the Y axis.

Then I go through a for loop and get all of the other bubble guis that are part of that model and move them up by the determined size. This doesnt seem to be working though because sometimes they will still overlap.

Does anyone have any ideas? Thank you and have a good one!

SOLVED = I wasnt dividing the size in the original positioning function. Which was causing offset problems.