However in-game I have THIS issue https://gyazo.com/b91c937353e1c86fa5f1bbc294cdbd2d
it goes up TOO high
I use offset for size and scale for position
How can I solve this? All help is greatly appreciated.
I recommend using something guaranteed to work, such as moving the button up 15% of its current size. You can change the 15% to your liking until it works how you want. Example, (and note that it is not connected to the cursor hover events):
local button = … -- path to your button
local y_delta_percent = 0.15 -- 15% of the button’s size
local x_scale, x_offset, y_scale, y_offset = button.Size
local y_delta_scale = y_scale * y_delta_percent
local y_delta_offset = y_offset * y_delta_percent
function onButtonHover()
button.Position = button.Position + UDim2.new(0, 0, y_delta_scale, y_delta_offset)
-- Your other code
end
function onButtonHoverEnd()
button.Position = button.Position - UDim2.new(0, 0, y_delta_scale, y_delta_offset)
-- Your other code
end
-- Down here you need to create connections to those functions for your hover start and end events