Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I setup ImageRectOffset?

I've been testing out a bunch of stuff to why my image button won't work. I'm unsure if I might've set up the ImageRectOffset wrong. Any help on how to fix it?

local ImageButton = script.Parent

ImageButton.MouseEnter:connect(function()
ImageButton.ImageRectOffset.unit = Vector2.new(0, 50)
end)

ImageButton.MouseLeave:connect(function()
ImageButton.ImageRectOffset.unit = Vector2.new(0, 0)
end)

1 answer

✓ Accepted answer

You seem to be putting .unit after ImageRectOffset but ImageRectOffset itself is a property and it does not have any properties.. that property itself can be set to a Vector2 so you don't need the .unit afterwards.

This discussion is preserved as it was. New answers, comments, and votes are closed.