Hi devs,
I’m wanting to know if there’s a way to compare UDim values.
Is there a way to do this?
Hi devs,
I’m wanting to know if there’s a way to compare UDim values.
Is there a way to do this?
You cant unless you break the udim2 and compare them seperately.
print(UDim.new(0, 0) == UDim.new(0, 0)) --true
print(UDim.new(0, 0) == UDim.new(math.pi, math.pi)) --false
‘UDim’ values (objects) are treated as first class values so Luau’s comparison operations apply.
Do you know if there’s a way to split the x and y?
I’ve tried using .X and .Y but it gave an error.
UDim doesn’t have X or Y. It is Scale & Offset.
UDim2 has X and Y with Scale & Offset.
UDim:
UDim2: