#Hover Script Inside Button Not Working Correctly
1 messages · Page 1 of 1 (latest)
I just made this text button for my game , i inserted a hover script i have used before that worked correcly, but for some reason now it doesnt work as it should? please help
local button = script.Parent
local TweenService = game:GetService("TweenService")
-- Store original size
local originalSize = button.Size
local hoverSize = originalSize + UDim2.new(0.02, 0, 0.02, 0) -- 5% bigger
local tweenInfo = TweenInfo.new(
0.15,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out
)
local growTween = TweenService:Create(button, tweenInfo, {Size = hoverSize})
local shrinkTween = TweenService:Create(button, tweenInfo, {Size = originalSize})
button.MouseEnter:Connect(function()
growTween:Play()
end)
button.MouseLeave:Connect(function()
shrinkTween:Play()
end)
try printing on mouseenter and mouseleave
also js use uiscale and set anchorpoint to .5, .5
its much easier
it scales my text button, right? ive never used it before
noo idea what that is , im sorry
yes, and its value is an integer
try adding a UIScale on your button
ok i will but im not sure why i need it since its alr scaled
what do i scale it to
add a print("ENTER") and print("LEAVE") on your button.MouseEnter and button.MouseLeave for debugging
i dont have those buttons?
huh
do you write this script?
or
gpt
oh
no
gui one then?
done
show the size property of your textlabel
oh yeah
just type 1 on that and press enter
so it sets the size to scale instead of pixel
{1, 0}, {1, 0}
show the size of button and imagelabel
use an autoscale plugin
** You are now Level 8! **
to turn the size into scale
i thought your button is already in scale based off the script 😭
** You are now Level 6! **
is it this
yes
the scale text one?
no
unit conversion
it worked