Button size keep going to .025 when I tween it

Why is this thing keep making the x and y scales to to .025 even though I take the size of the button and subtract it by .025.

Script:

local Players = game:GetService('Players')
local TweenService = game:GetService('TweenService')

local Button = script.Parent

local OpenInfo = TweenInfo.new(
    0.3,
    Enum.EasingStyle.Back,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)

local CloseInfo = TweenInfo.new(
    0.3,
    Enum.EasingStyle.Back,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)

local ButtonClose = TweenService:Create(Button, CloseInfo, {Size = UDim2.new(Button.Size.X.Scale + 0.025, Button.Size.X.Offset, Button.Size.Y.Scale + 0.025, Button.Size.Y.Offset)})
local ButtonOpen = TweenService:Create(Button, OpenInfo, {Size = UDim2.new(Button.Size.X.Scale - 0.025, Button.Size.X.Offset, Button.Size.Y.Scale - 0.025, Button.Size.Y.Offset)})

local Events = {
    MouseEnter = function()
        ButtonOpen:Play()
    end,

    MouseLeave = function()
        ButtonClose:Play()
    end,

    MouseButton1Down = function()
        
    end,
}

for event, eventFunction in pairs(Events) do
    Button[event]:Connect(eventFunction)
end

I fixed it. [character limits]

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