You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
When the player picks up a collectable part on the map, I would like it to “poof” with a small burst of stars/sparkles.
What is the issue? Include screenshots / videos if possible!
I’m not quite sure how to script this. I know how to add particle emitters and parts can be collected by the players just fine, I just can’t figure out how to create the “burst” effect.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried making the particle emitter turn on for a ~0.5 seconds or so, then turn back off, but it ended up looking very delayed and unappealing. I couldn’t find anything for this specific effect on the Developer Hub.
Make the particle speed ramp from a very high speed to a lower one as it’s lifespan ends.
Lower the coin’s lifespan if it’s not fast enough
Make a script that makes the particle emitter emit a # of particles when the coin is touched. Here’s a example of what it would look like if it was a child under the particle emitter, which is a child of the coin.
local function Explode (touchedPart)
if touchedPart.parent.FindFirstChild("Humanoid") then
script.parent.parent.Transparency = 1
script.parent:Emit(**# of particles you want to emit**)
task.wait(script.parent.Lifetime)
script.parent.parent:Destroy()
end
end
script.parent.parent.Touched:Connect(Explode)
This can be achieved simply by using a Particle Emitter instance.
-- Assuming that coin is already defined and that there is a particle emitter object parented to the coin
coin.Touched:Connect(function()
coin.ParticleEmitter:Emit(20) -- The number of particles that you want to emit.
coin:Destroy() -- Make the coin disappear
end)