I’ve been working on making my Backrooms game’s menu better and decided to give the UI some animations (Buttons growing larger when you hover over them, menus sliding up when they open, that sort of thing.) and I made this script to make a button grow to 1.25x its size when you hover over it.
local button = script.Parent
local size = script.Parent.Size
local pos = script.Parent.Position
defaultSize = {{0.13, 0},{0.55, 0}}
defaultPos = {{0.43, 0},{0.51, 0}}
local function hover()
button.MouseEnter:Connect(function()
size = {{0.1625, 0},{0.6875, 0}}
end)
button.MouseLeave:Connect(function()
size = defaultSize
pos = defaultPos
end)
end
hover()
When I playtest it it does nothing. I tried putting the functions in a while loop however that makes the game completely unplayable from lag. Does anyone know what I did wrong?