Hi I’m trying to make a firework explosion but I don’t know how to go about it, I’m not asking for full scripts but I just don’t know where to start. Do I use a particle emitter? Do I use Instance.new or do I make it beforehand? Do I use an animation?
Animations are for character
What you should do is create module called VFX and store Constants table and Functions inside of it, then if you want to add firework VFX you do:
local VFX = {}
local Constants = {
["Firework"] = {
DespawnTime = 2,
Color = Color3.new(1,0,0)
}
}
function VFX.Functions.firework(Origin: Vector3)
--/ Firework logic
end
return VFX
For the firework itself, it depends, usually you’ll create some part, play a sound and then use particle emmiter to add some look to it
Make the particle beforehand, set it’s rate to 0 and when you want the explosion do ParticleEmitter:Emit(amount)
Where should I parent the particle emitter?
I’d recommend making an invisible non-collidable part, adding an attachment inside that and parent the particleemitter to that!
Should I put it in server storage and clone it right before the firework blows up?
(sorry, late reply)
Yeah, I think you should (Or ReplicatedStorage, I dont think it makes a huge difference though). Afterwards, you can clone it into workspace and call :Emit()
on the particleemitter and destroy the part after the particles are emitted
Yes I already made it and it works perfectly thank you!
The only trouble I had was that I didn’t know I needed a task.wait() right after it gets parented or else emit() won’t work