#how to make coin adding animation
18 messages · Page 1 of 1 (latest)
i need to make it so that when coins are added to the player, the number of added coins appears in the center and moves to the lower right corner
use tweens
set the text as the number of coins added just like that
?
TextLabel.Text = tostring(numberofcoinsadded)...
textlabel:GetAttributeChangedSignal("Text"):Connect(function()
-- bounce animation
local style = Enum.EasingStyle.Sine
local bounceOffset = 0.2 -- in scale
local offset = Vector2.yAxis * (textlabel.Size.Y * bounceOffset)
-- bounce up
textlabel:TweenPosition(
textlabel.Position + offset, -- upwards
Enum.EasingDirection.In,
Enum.EasingStyle.Sine,
.2
)
task.wait(.2)
-- bounce back down
textlabel:TweenPosition(
textlabel.Position - offset, -- downwards
Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,
.1
)
end)
``` heres a quick example
a gui tween would play whenever its text changed
i havent tested yet
what are you saying