-
What do you want to achieve? How i can make this button?
-
What is the issue?
-
What solutions have you thought of so far? I try see in youtobe 2-3 hours and later i see nothing for this “animation”, and i try see in devforum but, the dont have to.
2 Likes
If you wanted it to be really simple, you could just make two decals and have it switch between them when clicked. As in, one normal and one pushed-in.
2 Likes
You can achieve this by simply tweening the position (udim2), more specifically the Y, of the UI that says “double cash”. And, have a frame or something ‘below’ the UI you want to move.
Play that tween when the button is clicked, or .Activated
and there you go.
Code (local script):
local TweenService = game:GetService("TweenService")
local button = script.Parent.TextButton
local frame = script.Parent.Frame
local tweenInfo_a = TweenInfo.new(0.15,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,true)
local tweenToPlay = TweenService:Create(button, tweenInfo_a, { Position = UDim2.new(button.Position.X.Scale,button.Position.X.Offset,frame.Position.Y.Scale,frame.Position.Y.Offset) } )
button.Activated:Connect(function()
tweenToPlay:Play()
print("button pressed!")
end)
Video:
RBXL file:
simple button.rbxl (59.1 KB)
7 Likes
I just come to pc thx for!! {you save my time}
4 Likes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.