Hey Developers, I’m gonna keep this short and simple but how can I achieve an effect where if you hover over a imagebutton or a imagelabel it has a smooth tween animation going a little bit darker than the original color.
local TweenService = game:GetService("TweenService")
local TweenInfoColor = TweenInfo.new(0.3) -- times it takes for tween
local imagebutton = script.parent
imagebutton.MouseEnter:Connect(function()
TweenService:Create(imagebutton, TweenInfoColor, {ImageColor3 = Color3.fromRGB or Color3.fromHSV(0,0,0))
end)
---You can do something for mouse leave if you want. Imagebutton is object's property you are changing. ImageColor3 is the specified property you want to change of image button. You can then give the exact value of how dark you want it to be.
ImageButton.MouseEnter:Connect(function()
TweenService:Create(ImageButton, TweenInfo.new(0.2), {ImageColor3 = Color3.new(0.5, 0.5, 0.5)}):Play()
end
ImageButton.MouseLeave:Connect(function()
TweenService:Create(ImageButton, TweenInfo.new(0.2), {ImageColor3 = Color3.new(1, 1, 1)}):Play()
end