How to change particle emitter transparency SMOOTHLY

Hello I was wondering how I can achieve a transition of making my particle emitter slowly fade. I am confused on how to achieve and IMPLEMENT this. Could someone please help me?


local particle = script.Parent.ParticleEmitter --THIS IS THE PARTICLE EMITTER THAT WILL CHANGE.

local setting = {
	wait_time = 1, --HOW MUCH TIME THAT SHOULD WAIT AFTER THE SMOKE APPEARS OR FADES
	fade_time = 0.3, --HOW FAST IT TAKES TO FADE/APPEAR
	
	min_fade = 0, --HOW MUCH SMOKE TO APPEAR. ( 0 = NOT TRANSPARENT, 1 = VERY TRANSPARENT )
	max_fade = 1, --HOW MUCH SMOKE TO DISAPPEAR ( 0 = NOT TRANSPARENT, 1 = VERY TRANSPARENT )
}
-----------------			-----------------

while true do --Infinite loop.
	task.wait(setting.wait_time)
	
	
	--MAKE THE PARTICLE APPEAR:
	while particle.Transparency > setting.min_fade do
		task.wait(setting.fade_time)
		
		particle.Transparency = particle.Transparency - 0.05 --Slowly fade the transparency.
		if particle.Transparency <= setting.min_fade then
			particle.Transparency = setting.min_fade --Make the particle final transparency to 0.
			break; --End THIS loop.
		end
	end
	
	task.wait(setting.wait_time)
	
	--MAKE THE PARTICLE DISAPPEAR:
	while particle.Transparency < setting.max_fade do
		task.wait(setting.fade_time)

		particle.Transparency = particle.Transparency + 0.05 --Slowly fade the transparency.
		if particle.Transparency >= setting.max_fade then
			particle.Transparency = setting.max_fade --Make the particle final transparency to 0.
			break; --End THIS loop.
		end
	end
	
end

Couldnt you add a Transition by clicking the 3 Dots on the Side of the Property?

  1. Click on the Transparency Box

  2. Go to the Right, and Click the 3 Dots

Screenshot (82)

You Should get this Panel which is where you can edit certain parts of the Particle:

You can also do this with size

I’m not sure why you are using a script unless I’m completely missing something


You also just Disable the Effect or use TweenService if you want the Whole effect to change, and not a part of it

1 Like

Thank you. I actually did not think of this method.

A ParticleEmitter’s Transparency cannot be set with a number. You have to use a NumberSequence if you want to change it.

You can also use TweenService to manipulate other properties as well.

Ah, thats what it was called…

Any chance I could get an example of NumberSequence being using in a loop to fade transparency? :slight_smile:

This is a small Example of setting up a NumberSequence with a Script:

script.Parent.Transparency = NumberSequence.new(1, 0.1)

Starts as 1 and Ends as 0.1

Its better to use TweenService for this occassion tho

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.