Creating a cash animation

I want to try creating a cash animation when a player earns cash, so like a bunch of icons are created, and they kinda spray out like a fountain, or something a long those lines. What I’ve got at the moment is pretty pathetic tho

local TweenService = game:GetService('TweenService')

local function CreateCash()
	local Cash ='ImageLabel')
	Cash.AnchorPoint =, 0)
	Cash.BackgroundTransparency = 1
	Cash.Position =, 0, 1, 0)
	Cash.Size =, 0, 0.9, 0)
	Cash.Image = ''
	Cash.ScaleType = Enum.ScaleType.Fit
	local AspectRatio ='UIAspectRatioConstraint')
	AspectRatio.Parent = Cash
	return Cash

return function(parent)
	for i = 1, 20 do
		local Cash = CreateCash()
		Cash.Parent = parent
		local Move = TweenService:Create(
			{Position =, 100) / 100, 0, math.random(10, 100) / 100, 0)}
end (1)

1 Like

You could try getting the Screen Size and then use that inside of your math.random(), that way they can appear across the entire screen. After a couple more seconds you could tween them to the total cash the player has on the top right and then destroy them.
GuiBase2d.AbsoluteSize is what you can use to get the screen size, but there are other methods as well.

1 Like

I’m not trying to cover the entire players screen. I just want a small animation over near the top right

you can still do it the way @SimplyData told ya.

Just make them spread in the top left like how you already made it and then tween each one to the top right.

Not really what I’m after tho.

More updated version, but it’s still eh
robloxapp-20200222-2043231 (1)

Maybe try tweening them so they move over the cash icon?

1 Like