This might help:
local billboardgui = script.Parent.BillboardGui
wait(5)
function HalfUDim2(sze)
local UD2W = sze.Width
local UD2H = sze.Height
local XS = UD2W.Scale ~=0 and UD2W.Scale/2 or UD2W.Scale
local XP = UD2W.Offset ~= 0 and UD2W.Offset/2 or UD2W.Offset
local YS = UD2H.Scale ~=0 and UD2H.Scale/2 or UD2H.Scale
local YP = UD2H.Offset ~= 0 and UD2H.Offset/2 or UD2H.Offset
return UDim2.new(XS,XP,YS,YP)
end
for i, child in pairs(billboardgui:GetChildren()) do
local halfsize = HalfUDim2(child.Size)
local halfpos = HalfUDim2(child.Position)
child:TweenSizeAndPosition(halfsize, halfpos)
end
let me know if you need more info!
Hope this helps!
2 comments
UDim2 values consist of, to my knowledge: UDim2.X, UDim2.X.Offset, UDim2.Y, UDim2.Y.Offset. If this is not correct, please inform me.
Could you give an example? I only worked with TweenService on Frame tweening positions