'Particles' in a GUI

How can I make like particles fall down my GUI Frame?

8 Likes

Just saying, exchange of doing this, why don’t you just set camera CFrame to a certain CFrame, and then, on the CFrame you can add background.

2 Likes

Because I need it to pour confetti on top of a black frame

1 Like

If you want to do confetti then you have to use cloning,destroying,division and math.random I saw a tutorial about this somewhere just divide it by 1000 because positions are only a single digit (by single digit i mean like positions are made up of 3 values but each value is only like 0 or 1 or -1 etc)
if your feel like it you can do random rotations

for example:
math.randomseed(tick())
local frame = script.Parent

while true do
wait(0.1)
local randomnumber = math.random(position1, position2)
local clonedframe = frame:Clone()
clonedframe.Parent = script.Parent.Parent
clonedframe.Position = UDim2.new(randomnumber,randomnumber,randomnumber)
wait(0.2)
clonedframe:Destroy()
end

not sure if that will work tho

I’ve created a simple easily modifiable example that shows how you could use a for loop and some tweening to create some nice, simple confetti that rains down the screen. Is this what you were looking for?

local totalTime = 5 -- how many seconds it will run
local confetti = Instance.new("Frame")
confetti.Size = UDim2.new(0.02, 0, 0.04, 0)
confetti.AnchorPoint = Vector2.new(0.5, 0.5)
confetti.ZIndex = 1 -- change this to go over the black frame
local rate = 15 -- how much confetti per second

for _ = 1,rate*totalTime do
	local newConfetti = confetti:Clone()
	newConfetti.BackgroundColor3 = Color3.fromRGB(math.random(150,255), math.random(150,255), math.random(150,255)) -- random color that is not dark
	newConfetti.Position = UDim2.new(math.random(3,97)/100, 0, -0.1, 0)
	newConfetti.Rotation = math.random(-360,360)
	newConfetti.Parent = script.Parent
	local randomLifetime = math.random(7,15)/10
	game:GetService("TweenService"):Create(newConfetti, TweenInfo.new(randomLifetime, Enum.EasingStyle.Linear), {Rotation = math.random(-360,360), Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(newConfetti.Position.X.Scale, 0, 1.1, 0)}):Play()
	game.Debris:AddItem(newConfetti, randomLifetime)
	wait(1/rate)
end

keep in mind that rates over 30 will tend to be slower and take longer than the set time due to the limits of wait()

40 Likes

Is there a way to make it slow down a bit?

1 Like

increase the randomLifetime variable; just double it to math.random(14,30)/10

2 Likes