Comparing two Vector 2`s causes error

I want to be able to compare a guis size and see if its smaller than the minimum size then if so to rescale it to that minimum size

But for some reasson when I compare the Absolute size with the minimum absolute size it gives me a error

I tried looking for some solutions but I wasen`t able to

Code causing error

--In the real code the Min size is stated at the start
local MinWindowTopSize = Vector2.new(0.235,0.05)

if WindowFrame.Parent.AbsoluteSize < (Cam.ViewportSize/MinWindowTopSize) then
	WindowFrame.Parent.Size = UDim2.new(MinWindowTopSize.X,0,MinWindowTopSize.Y,0)
end

if any help is appriciated : D

1 Like

i believe you might want to compare both the Vector2’s X value and Y value seperate that should fix the issue

3 Likes

I splited the if statment and made each check if the its Axis then if it was smaller it set it to the Min sizes appropriate axis and it worked! but this is still weird that it dosen`t work and also thank you : D

2 Likes