Comparing Udim.Y with a number

In this script, the goal is, once the Udim.Y value of a scroll frame exceeds 700 it makes a button interactable. The issue is, I cannot compare the valies.

I’ve tried:

if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y >= 700 then
-- code
end

I’ve also tried -700 and converting (y) to a number

Well this is how UDIM2 looks on a scrollframe

Screenshot 2024-08-07 at 5.45.48 PM

so you would have to do .Size.Y.Scale or .Size.Y.Offset to get the number value

Well if you read my issue you can clearly see I’m working with a “CanvasSize” which is Udim not Udim2, they are two completely seperate things.

oh my bad but you still have to specify if you want to check the offset value or scale value so

if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y.Scale >= 700 then
-- code
end

or

if MainFrame.Parent.RuleMeny.Co
ntent.CanvasSize.Y.Offset >= 700 then
-- code
end

Okay so update, I was a bit daft when posting. It’s CanvasPosition. Ill post with the errors.

You’re printing MainFrame.Parent.RuleMenu.Content.CanvasPosition.Y and it’s working but in the if statement you’re still checking CanvasSize.Y

:sob: thanks dude, im really tired rn

all good it happens lmao
Ttttttt

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.