I am helping my friend make a game and in there I am making a EXP UI. The problem is when the exp changes its too bland. I want a 2d particle emitter to emit particle at the right side of the ui. (IDK how to do it)
You should try searching the forums before posting.
1 Like
did found nothing useful
As @itsLevande stated, there is a module called rParticle that can be used to emit “2D Particle”.
You can do the following with rParticle:
LocalScript in a frame located right side of the EXP UI:
--create a particle
local Particle : ImageLabel = Instence.new("ImageLabel")
local Imgae = "rbxassetid://[Insert Particle Image Here]"
Particle.ImageID = Imgae
--create the emitter with rParticle and end it after one second when value changed
local NumberValue : NumberValue = path.to.NumberValue
NumberValue.changed:connect(function()
local ParticalEmitter = require(Path.to.rParticle).new(script.Parent, game.ReplicatedStorage:WaitForChild("ParticleVP"))
ParticalEmitter.rate = [Insert a float value here]
ParticalEmitter.onSpawn = function(particle)
particle.velocity = Vector2.new(math.random(-700, 700), 500);
particle.maxAge = 10;
end
ParticalEmitter.onUpdate = function(particle, deltaTime)
particle.velocity = particle.velocity - Vector2.new(0, 10);
particle.position = particle.position - (particle.velocity/3 * deltaTime);
end
task.wait(0.1)
ParticalEmitter.isDead = true
end)
1 Like
ok first that script has many spelling mistakes but it works so aint mad at all. and Thanks! I will be marking @itsLevande post if thats ok with you.
1 Like
I’m not sure how I missed those spelling errors after all this time! Thanks for pointing that out.
I’ve fixed that in the original post.