How would I smoothly tween the transparency of a particle emitter?

I’m trying to figure out how I would Tween the transparency of a particle emitter which is already enabled. Number sequences do not work as the whole beam needs to change at once. (The beam is designed to look like a light effect, made of blurry circles)

I’ve been trying different methods, the standard one I went to printed that Transparency is not a value that can be Tweened. The second attempt did not work, what I did:

local value = Instance.new("NumberValue", script)
		value.Value = ToGo
		value:GetPropertyChangedSignal("Value"):Connect(function()
			PE.Transparency = NumberSequence.new(value.Value)
		end)
		
		local ts = game:GetService("TweenService")
		local ti = TweenInfo.new(Time, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)
		local tp = {Value = ToGo}
		local t = ts:Create(value, ti, tp)
		t:Play()
		
		wait(Time + 1)
		value:Destroy()
end

This would have been a bad method anyway, and so now I’m confused as to how I’d go about this?

Please bear in mind:

  • I did not use a number sequence as the particles needed to all change at once, and stay at the end transparency.
  • I have not used a for loop as I was unsure if the effect would be smooth, and I need it to use no wait()s as the effect happen at the same time as a few others, however I will use it as a last resort with a spawn(function().

Any help would be greatly appreciated, thanks!
~ Irideon

2 Likes

TweenService doesn’t support NumberSequences. You would have to use loops to change the Transparency.

What you could do, is tween a number value, and connect a runservice event to update the transparency based off of the number value.

If you need me to walk through the steps let me know.

11 Likes

Thanks for this! Helped a lot since it’s been bugging me for months, but it’s never been urgent. Marking as solution.

3 Likes

Can you please give example code of this, thanks. I want the particle to fade away rather than just go away.